A simple in-memory key-value store with concurrency and strict types.

A simple in-memory concurrent cache server and CLI, packaged into one.
Unlike Redis, AtmosDB doesn't infer datatypes but demands explicit types.
All operations are atomic and thread-safe.
AtmosDB tries to achieve a low memory footprint for large number of key-value pairs, with a tradeoff on latency for concurrent connections.
Server currently communicates on HTTP/1.1, making it possible to connect to the server through a driver written in any language (planned).
Clone the repository and execute the following to install atmos-cli
locally:
$ go build
$ go install
Start the AtmosDB server:
$ atmosdb
On a different terminal window, run the CLI to connect to the server:
$ atmosdb cli <server_host_port> # http://localhost:8080
Warning
CLI does not run on Git Bash due to a known issue.
These are the commands currently supported:
db.version
Prints the server's version.GET key
Prints the value stored in the key along with its datatype, or .EXISTS key
Prints true if key exists, else false.SETINT key val
Upserts the key-value pair, val must be integer.SETFLOAT key val
Upserts the key-value pair, val must be float.SETSTR key val
orSETSTR key "val with spaces"
Upserts the key-value pair, val can be anything but will be stored as string.SETINT.TTL key val ttl
Upserts the key-value pair with TTL, val must be integer, ttl is in seconds.SETFLOAT.TTL key val ttl
Upserts the key-value pair with TTL, val must be float, ttl is in seconds.SETSTR.TTL key val ttl
orSETSTR.TTL key "val with spaces" ttl
Upserts the key-value pair with ttl, val can be anything but will be stored as string, ttl is in seconds.DEL key
Deletes the key-value pair if exists.INCR key
Increments the value by 1, stored value must be int.DECR key
Decrements the value by 1, stored value must be int.
int, float and string datatypes are currently supported.
v0.1
Contributions are welcome!
Improvements and TODOs:
- Implement better connection pooling, or look for other transport layer approaches for keeping client connections open.
- Support sending events and client subscriptions.
- Support arrays and sets and their corresponding operations.
- Support other basic commands like
INCRBY
,DECRBY
,EXPIREAT
,GETEXP
or any other for common usages. - Write drivers for languages like Java and Go.
- Implement transactions.