How sachin-bansal94/distribute-kv-store works
This repository contains a distributed key-value store alongside an earlier standalone TCP server. The main workflow is client command → primary processing → synchronous replication to healthy backups → local apply and WAL persistence → client response; reads are served locally. A background monitor probes and catches up replicas. Backup nodes enforce sequence ordering and persist replicated writes. The README documents the broader protocol and recovery behavior; source excerpts show the storage, WAL, command, and socket-handling implementations, but not every primary-server path.
Main entry points: primary_node.cpp Command processing · backup_node.cpp Backup protocol · kv_server_week4.cpp Standalone TCP server
Components 14
Primary node
- Primary server
primary_node.cpp - Command processing
primary_node.cpp - Primary LRU store
primary_node.cpp - Primary WAL
primary_node.cpp
Replication and recovery
- Replication manager
primary_node.cpp - Health monitor
primary_node.cpp
Backup nodes
- Backup node
backup_node.cpp - Backup protocol
backup_node.cpp - Backup LRU store
backup_node.cpp - Backup WAL
backup_node.cpp
Standalone server
- Standalone TCP server
kv_server_week4.cpp - Standalone commands
kv_server_week4.cpp - Standalone LRU store
kv_server_week4.cpp
Other components
- Client
Connections 15
- Client → Primary server: sends commands
README.md - Primary server → Command processing: dispatches
README.md - Command processing → Replication manager: replicates writes
README.md - Replication manager → Backup node: sends SEQWRITE
README.md - Command processing → Primary LRU store: applies writes
README.md - Command processing → Primary WAL: appends writes
README.md - Command processing → Primary LRU store: serves reads
primary_node.cpp - Health monitor → Backup node: probes and syncs
README.md - Health monitor → Primary WAL: replays entries
README.md - Backup node → Backup protocol: handles connections
backup_node.cpp - Backup protocol → Backup LRU store: applies writes
backup_node.cpp - Backup protocol → Backup WAL: persists writes
backup_node.cpp - Client → Standalone TCP server: sends commands
kv_server_week4.cpp - Standalone TCP server → Standalone commands: dispatches
kv_server_week4.cpp - Standalone commands → Standalone LRU store: reads and writes
kv_server_week4.cpp