NIMPHA

module
v0.0.0-...-a7987e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: MIT

README

Pet In-Memory database. Ideally it will be:

  1. Distributed
  2. able to perform changes in one node and replicate to others
  3. Fully RSOCKET based
  4. ...?

alt text

Standalone docker image for development dockerfile

docker build -t imagename -f dockerfile .
docker run -it -p 10001:10000 -p 8001:8000 -p 9091:9090 imagename

For testing the docker image a post request to the localhost port 9091 with a query can be executed:

Insert in the table (and creates it if it doesn't exists:

POST http://127.0.0.1:9091/execute_query_method HTTP/1.1
content-type: application/json

{
    "method": "execute_query",
    "query": "insert into tabclient (clientid, name, address, country , email) VALUES (3, 'Julio', 'Fazenda', 'BR', 'julio@someplace.com')"
}

Select from that table

POST http://127.0.0.1:9091/execute_query_method HTTP/1.1
content-type: application/json

{
    "method": "execute_query",
    "query": "select * from tabclient"
}

Delete from that table

POST http://127.0.0.1:9091/execute_query_method HTTP/1.1
content-type: application/json

{
    "method": "execute_query",
    "query": "delete from tabclient where email = 'julio@someplace.com'"
}

TODO:

  • Update
  • Error treatment
  • Guarantee insert concurrency - Should be guaranteed by the elected WAL node as is
  • WAL node election mechanism
  • Node unavailability treatment
  • Separate components in the code (refactor)
  • Replication of WAL- WAL is replicated and on error (node down) triggers a data recovery event in one of the nodes
  • Replication of data
  • Indexing mechanism (BTREE partially implemented)
  • Sharding - Sharding strategy : TABLE
  • Sharding - Sharding strategies : Alphabetic order, index range, ...?
  • Convert from HTTP to a protocol lower in the OSI model Done with RSOCKET
  • Remove non rsocket communication
  • refactor code to Golang standard naming convention. Started with snake case but had to change due to Golang standards.
  • Drivers for usage by client systems (Created HTTP load balancer. Clients should use post requests

TODO Parser:

  • INSERT
  • DELETE
  • UPDATE
  • select with subqueries
  • Select without where clause: Currently to get all rows we need a where clause containing an always true condition (i.e. where 1 = 1)
  • Mathematical operations
  • Case When
  • Nested Case When
  • ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL