A simple in-memory key-value database with a custom TCP-based protocol supporting features like TTL, LRU eviction, snapshots to disk, single-leader replication, off-heap storage, and a CLI. For details and documentation see the wiki.
You will need the following dependencies installed:
Run the following to clone the repository and run the setup script.
git clone https://github.com/youngbryanyu/SimpliStash.git
cd SimpliStash
chmod +x setup.sh
./setup.sh
The setup script does the following:
- Compiles the source code
- Creates symbolic links to executables
sstash.sh
andsstash-cli.sh
To start the database server, run sstash <primary_port> <read_only_port> [master_ip] [master_port]
. See the example below.
To run the CLI, run sstash-cli <ip> <port>
. See the example below.
sstash 3000 3001
: Starts a master node with its main server on port 3000 and read-only server on port 3001 using.sstash-cli localhost 3000
: Connects to the master node's primary port using the CLI.sstash 4000 4001 localhost 3000
: Spins up a read-replica of the master node listening on port 3000. The read-replica's read-only server listens on port 4001.sstash-cli localhost 4001
: Connects to the read-replica's read-only port using the CLI.
In the above example, both nodes are spun up in the same machine on the same IP address, but the nodes don't necessarily need to be in the same machine.
For command usage details and examples, see the wiki.
This project is currently paused. If you are interested in extending it, you will need to fork the repo. Reach out to me at [email protected]
if you have any questions.