How ixaruss/rushdb works
RushDB is a small Redis-inspired key-value service with a TCP server, binary request/response protocol, CLI, and snapshot persistence. The main workflow runs from a user command through CLI dispatch and a TCP query to server-side storage, then returns a response. The README documents periodic snapshots, but the sampled server code has its snapshot loop commented out; persistence load/save routines are present. Arrows rely on sampled calls or README statements, so unsampled runtime details are not inferred.
Main entry points: server.rs TCP server · cmd.rs Command dispatch · io.rs Protocol I/O · shell.rs Interactive shell
Components 15
CLI
- CLI entry
cli/src/main.rs - Command dispatch
cli/src/cmd.rs - Interactive shell
cli/src/shell.rs - Shell completion
cli/src/util.rs - TCP client
cli/src/client.rs
Protocol
- Protocol I/O
common/src/io.rs - Request types
common/src/serevrtypes.rs - String codec
common/src/str.rs
Server
- Server entry
db/src/main.rs - TCP server
db/src/server.rs - Server config
db/src/conf.rs - In-memory store
db/src/engine.rs
Persistence
- Snapshot manager
db/src/persistence.rs - Snapshot file
Other components
- User
Connections 18
- User → CLI entry: runs
README.md - CLI entry → Command dispatch: starts
cli/src/main.rs - Command dispatch → TCP client: queries
cli/src/cmd.rs - Command dispatch → Interactive shell: starts
cli/src/cmd.rs - Interactive shell → Command dispatch: dispatches
cli/src/shell.rs - Interactive shell → Shell completion: uses
cli/src/shell.rs - TCP client → Protocol I/O: sends and receives
cli/src/client.rs - TCP client → TCP server: sends TCP requests
README.md - Protocol I/O → Request types: encodes and decodes
common/src/io.rs - Protocol I/O → String codec: uses
common/src/io.rs - Server entry → TCP server: starts
db/src/main.rs - TCP server → Server config: loads
db/src/server.rs - TCP server → Snapshot manager: loads snapshot
db/src/server.rs - TCP server → Protocol I/O: receives and sends
db/src/server.rs - TCP server → In-memory store: reads and mutates
db/src/server.rs - Snapshot manager → Snapshot file: reads and writes
db/src/persistence.rs - Server config → Snapshot file: configures path
db/src/conf.rs - TCP server → Snapshot manager: periodically saves
README.md