How dimpleh21/memstore works
MemStore is a Redis-like in-memory key-value server with a command-line client. The main workflow is client input → command encoding and TCP transport → server command processing → shared data store → RESP response. The database also supports list and hash operations, key management, and persistence. The excerpts establish client startup and server startup/persistence; several internal client/server handoffs are documented only broadly, so those links are marked unverified rather than treated as inspected calls.
Main entry points: CLI.cpp Interactive CLI · RedisDatabase.cpp Dump and load · RedisServer.cpp TCP server · main.cpp Server entry
Components 13
Client
- Client entry
client/src/main.cpp - Interactive CLI
client/src/CLI.cpp - Command codec
client/src/CommandHandler.cpp - TCP client
client/src/RedisClient.cpp - Response parser
client/src/ResponseParser.cpp
Server
- Server entry
server/src/main.cpp - TCP server
server/src/RedisServer.cpp - Command processor
server/src/RedisCommandHandler.cpp
Data and persistence
- Redis database
server/src/RedisDatabase.cpp - Dump and load
server/src/RedisDatabase.cpp - Persistence file
server/dump.my_rdb
Other components
- CLI user
- Redis CLI
Connections 12
- CLI user → Client entry: starts
README.md - Client entry → Interactive CLI: runs
client/src/main.cpp - Interactive CLI → Command codec: encodes commands
- Interactive CLI → TCP client: sends commands
README.md - Interactive CLI → Response parser: parses replies
- Redis CLI → TCP server: sends commands
README.md - Server entry → TCP server: runs
server/src/main.cpp - TCP server → Command processor: dispatches commands
- Command processor → Redis database: reads and writes
server/src/RedisCommandHandler.cpp - Server entry → Dump and load: loads and dumps
server/src/main.cpp - Dump and load → Persistence file: reads and writes
README.md - Dump and load → Redis database: persists state
server/src/RedisDatabase.cpp