It provides a scalable, partition-based architecture with support for basic key-value operations across multiple tables. The system features one-shot ACID transaction properties and supports Raft consensus protocol for fault-tolerant replicas.
The key-value store supports the following operations:
PUT <key> <value>: Store a value for a given keyPUT <key> found: Key already exists, value updatedPUT <key> not_found: New key created
GET <key>: Retrieve a value for a given keyGET <key> <value>: Success, returns valueGET <key> null: Key not found
SWAP <key> <new_value>: Replace an existing valueSWAP <key> <old_value>: Success, returns old valueSWAP <key> null: Key not found
DELETE <key>: Remove a key-value pairDELETE <key> found: Success, key deletedDELETE <key> not_found: Key doesn't exist
SCAN <start_key> <end_key>: Retrieve keys and values within a rangeSTOP: Gracefully terminate the client
Key Format: Keys are formatted as table_name followed by a numeric identifier (e.g., customers123, products456). Each table is independently partitioned across servers.
cargo run --release --bin server -- [OPTIONS]-
--partition-id <PARTITION_ID>- Partition ID of the current node [default: 0]
- Specifies which data partition this server instance manages
-
--replica-id <REPLICA_ID>- Replica ID of the current node [default: 0]
- Identifies this server within its replica set for consensus
-
-c, --client-listen-addr <CLIENT_LISTEN_ADDR>- The address to listen on for client requests [default: 0.0.0.0:23000]
- Endpoint where clients connect to issue queries and commands
-
-p, --peer-listen-addr <PEER_LISTEN_ADDR>- The address to listen on for replica peer communication [default: 0.0.0.0:25000]
- Used for Raft consensus protocol traffic between replicas
-
-d, --db-path <DB_PATH>- Directory path for database files
- Example:
data/db/partition<PARTITION_ID>/replica<REPLICA_ID>
-
--log-path <LOG_PATH>- Directory path for Raft log files
- Example:
data/log/partition<PARTITION_ID>/replica<REPLICA_ID>
-
--persistent-state-path <PERSISTENT_STATE_PATH>- Directory path for Raft persistent state files
- Example:
data/state/partition<PARTITION_ID>/replica<REPLICA_ID>
-
--manager-addr <MANAGER_ADDR>- Address of the cluster manager [default: 0.0.0.0:24000]
- Used for coordination and discovery
-
--peer-replica-addr <PEER_REPLICA_ADDR>- Comma-separated addresses of peer replicas [default: ""]
- Format:
<replica_id>:<host>:<port>,<replica_id>:<host>:<port>,...
-
--persistence- Enable database persistence
- When enabled, data is stored on disk; otherwise data exists only in memory
-
--batch-size <BATCH_SIZE>- Batch size for write operations before flushing to disk
- Larger values improve throughput at the cost of potential data loss on crash
-
--batch-timeout <BATCH_TIMEOUT>- Timeout in milliseconds before a batch is flushed even if not full
- Ensures writes are not delayed too long when traffic is light
-
--log-seg-entry-size <LOG_SEG_ENTRY_SIZE>- Maximum size in bytes of each log segment file [default: 1048576]
- Controls when new log segment files are created for better manageability
cargo run --release --bin manager -- [OPTIONS]-
--listen-addr <LISTEN_ADDR>- The address for the manager service to listen on [default: 0.0.0.0:24000]
- Central endpoint that servers and clients connect to for coordination
-
--server-addrs <SERVER_ADDRS>- Comma-separated list of KV server addresses
- Format:
<host1>:<port1>,<host2>:<port2>,... - Used to establish the initial cluster configuration
-
--tables <TABLES>- Table configurations in format: table1=1000000,table2=2000000
- Numbers represent the key space size for each table
- Controls how data is partitioned across the cluster
-
--server-rf <SERVER_RF>- The replication factor of a partition [default: 3]
- Determines how many replicas exist for each data partition
- Higher values increase fault tolerance but reduce write performance
-
--backer-path <BACKER_PATH>- Path to durable storage directory under ./data/ (optional)
- Enables persistent storage of cluster metadata and configuration
cargo run --release --bin client -- [OPTIONS]--connect-addr <CONNECT_ADDR>The address to connect to [default: 0.0.0.0:24000]
cargo run --release --bin benchmark -- [OPTIONS]--connect-addr <CONNECT_ADDR>The address to connect to [default: 0.0.0.0:24000]
The client provides an interactive terminal where you can:
- Start a command with
cmd - Add operations with
op [operation] [args...] - Execute the command with
done - Toggle timing with
time - Clear the screen with
clear - Exit with
exitorquit

