Skip to content

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.

License

Notifications You must be signed in to change notification settings

youngbryanyu/SimpliStash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpliStash

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.

Prerequisites

You will need the following dependencies installed:

  • Maven version 3.9.6 (or newer)
  • Java version 8 (or newer)

Installation

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 and sstash-cli.sh

Running the Database

To start the database server, run sstash <primary_port> <read_only_port> [master_ip] [master_port]. See the example below.

Running the CLI

To run the CLI, run sstash-cli <ip> <port>. See the example below.

Example

  1. sstash 3000 3001: Starts a master node with its main server on port 3000 and read-only server on port 3001 using.
  2. sstash-cli localhost 3000: Connects to the master node's primary port using the CLI.
  3. 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.
  4. 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.

Contributing

This project is currently paused. If you are interested in extending it, you will need to fork the repo. Reach out to me at youngyu2002@gmail.com if you have any questions.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published