distributed-key-value-store/
βββ src/
β βββ main.rs
β βββ config.rs # CLI args and config parsing
β βββ cluster/ # Cluster logic: leader election, peer health, quorum
β β βββ mod.rs
β β βββ state.rs # Represents a node
β β βββ election.rs # Static-priority leader election
β β βββ quorum.rs # Quorum read/write logic
β βββ store/ # Key-value storage + persistence
β β βββ mod.rs
β β βββ engine.rs # In-memory or sled-backed key-value store
β β βββ lamport.rs # Lamport clock implementation
β β βββ wal.rs # WAL logging & replay
β β βββ snapshot.rs # Compaction + snapshot handling
β βββ replication/ # Batch replication system
β β βββ mod.rs
β β βββ batch.rs # Queue, flush interval
β β βββ handler.rs # Handles /replicate-batch endpoint
β βββ api/ # HTTP routes and handlers
β β βββ mod.rs
β β βββ client.rs # API endpoints
β β βββ state.rs # ApiState definition
β β βββ metrics.rs # Prometheus metrics definition
β βββ util/ # Common types & helpers
β β βββ mod.rs
β β βββ types.rs # Shared types: Value, Request, NodeID, etc.
βββ Cargo.toml
βββ README.md
βββ scripts/
βββ start_cluster.sh # Spins up 3+ nodes
βββ test_put_get.sh # CLI test driver
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||