Skip to content
/ mdb Public

A Rust-based LSM key-value store with TCP interface and SSTable storage.

Notifications You must be signed in to change notification settings

siam397/mdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDB

MDB is a lightweight key-value store written in Rust. It provides persistent storage using SSTables (Sorted String Tables) and Write-Ahead Logging (WAL). MDB supports basic operations like setting, getting, and deleting keys, with tombstone support for soft deletes, and background flushing/compaction.

MDB now also supports a TCP server mode, allowing clients to connect and issue commands over the network.

Features

  • Key-Value storage
  • Persistent storage using SSTables
  • Write-Ahead Logging (WAL) for crash recovery
  • Tombstone support for deletes
  • Background flushing and compaction
  • TCP server for remote client access

Usage

Run the server:

cargo run

Connect with a TCP client (e.g., netcat):

nc 127.0.0.1 4000

Issue Commands

SET mykey myvalue
GET mykey
DELETE mykey
GET_KEYS
          +-------------------+
          |     TCP Clients   |
          +-------------------+
                    |
                    v
           +----------------+
           |   TCP Server   |
           +----------------+
                    |
                    v
          +-------------------+
          |       DB Core     |
          |------------------|
          |  BTreeMap Cache   |
          |   handle_set/get  |
          +-------------------+
                    |
       ----------------------------
       |                          |
       v                          v
+---------------+          +----------------+
|  Write-Ahead  |          |  Storage Engine|
|      Log      |          |   (SSTables)  |
+---------------+          +----------------+
       |                          |
       v                          v
Background Flusher -------> Periodic Compaction
       |
       v
Deletes old WAL files

About

A Rust-based LSM key-value store with TCP interface and SSTable storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published