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).
AtmosDB also has a streaming feature where the client can subscribe to a key and all changes to the value of that key will be streamed to the client in an almost realtime manner.
Clone the repository and execute the following to install atmos-cli locally:
$ go build
$ go installStart the AtmosDB server:
$ atmosdbOn a different terminal window, run the CLI to connect to the server:
$ atmosdb cli <server_host_port> # http://localhost:8080Warning
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 <nil>.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 valorSETSTR 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 ttlorSETSTR.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.SUB key
Subscribes to the changes in values of the key, key can be of any type.
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,GETEXPor any other for common usages. - Write drivers for languages like Java and Go.
- Implement transactions.