How sumiiesque/mini-redis works
Mini-Redis is documented as a multithreaded RESP-compatible in-memory key-value server. Its intended client workflow is network event handling, worker dispatch, RESP parsing, command routing, and backend storage, with locking and MVCC implementations behind a shared interface. The source excerpts confirm the server entry point and locking backend, but the shown TCP server uses kqueue and only logs received bytes; parser, router, worker-pool, and MVCC wiring is not established by those excerpts. Documented relationships for those capabilities are therefore cited to the README.
Main entry points: tcp_server.cpp TCP server · command_router.cpp Command router · kv_backend.h KV backend API · mvcc_backend.h MVCC storage
Components 15
Network runtime
- Server entry
src/main.cpp - TCP server
src/network/tcp_server.cpp - Epoll reactor
src/network/epoll_reactor.cpp - Worker pool
src/thread/thread_pool.cpp - CPU affinity
src/thread/cpu_affinity.cpp
Protocol and commands
- RESP parser
src/protocol/resp_parser.cpp - RESP encoder
src/protocol/resp_encoder.cpp - Command router
src/router/command_router.cpp - Command model
src/common/command.h - Response model
src/common/response.h
Storage interface
- KV backend API
include/kv_backend.h
Locking engine
- Striped locking
src/backends/locking_backend.cpp
MVCC engine
- MVCC storage
src/backend/mvcc_backend.h - Epoch reclamation
src/backend/mvcc_backend.h
Other components
- Redis clients
Connections 16
- Server entry → TCP server: starts
src/main.cpp - Redis clients → TCP server: connects
README.md - TCP server → Epoll reactor: multiplexes events
README.md - TCP server → Worker pool: dispatches work
README.md - Worker pool → CPU affinity: pins threads
README.md - TCP server → RESP parser: receives RESP
README.md - RESP parser → Command router: passes commands
README.md - Command router → Command model: uses
README.md - Command router → KV backend API: executes commands
README.md - KV backend API → Response model: returns results
README.md - Command router → RESP encoder: encodes replies
README.md - RESP encoder → Redis clients: sends RESP
README.md - Striped locking → KV backend API: implements
- MVCC storage → KV backend API: implements
README.md - MVCC storage → Epoch reclamation: reclaims versions
README.md - TCP server → Redis clients: accepts connections
src/network/tcp_server.cpp