How scadoshi/steller works
Steller is a Redis-compatible in-memory key-value server. A client sends RESP commands over TCP; per-connection sessions parse and dispatch them, the domain applies cache or channel operations, and replies return in RESP. Mutations are logged, while periodic snapshots provide a recovery baseline; startup restores the snapshot and replays the log. The graph preserves the documented TTL, pub/sub, and graceful-shutdown branches. Some implementation details are unsampled, so their links are omitted rather than inferred.
Main entry points: session.rs Client session · mod.rs Persister · command.rs Command codec · server.rs TCP server
Components 19
TCP sessions
- TCP server
src/lib/inbound/server.rs - Client session
src/lib/inbound/session.rs - Reply mapping
src/lib/inbound/mod.rs
RESP protocol
- RESP framing
src/lib/resp/frame.rs - CRLF parsing
src/lib/resp/crlf.rs - Command codec
src/lib/resp/command.rs - Reply codec
src/lib/resp/reply.rs
Domain runtime
- Cache commands
src/lib/domain/command/cache/write.rs - Channel commands
src/lib/domain/command/channel.rs - Cache service
src/lib/domain/service.rs - In-memory cache
src/lib/domain/cache.rs - Pub/sub channels
src/lib/domain/channels.rs - TTL units
src/lib/domain/time.rs - Repository port
src/lib/domain/ports.rs
Persistence
- Persister
src/lib/outbound/persister/mod.rs - Append-only log
src/lib/outbound/persister/aof.rs - Snapshot store
src/lib/outbound/persister/snapshot.rs - File handle
src/lib/outbound/persister/persister_inner.rs
Other components
- Redis client
Connections 27
- Redis client → TCP server: connects via TCP
README.md - TCP server → Client session: spawns per connection
src/lib/inbound/server.rs - Client session → RESP framing: parses frames
src/lib/inbound/session.rs - RESP framing → CRLF parsing: uses CRLF parsing
- RESP framing → Command codec: lifts frames
src/lib/resp/command.rs - Client session → Command codec: dispatches commands
- Client session → Cache service: executes cache commands
src/lib/inbound/session.rs - Client session → Pub/sub channels: publishes and subscribes
src/lib/inbound/session.rs - Command codec → Cache commands: creates cache commands
- Command codec → Channel commands: creates channel commands
- Cache service → In-memory cache: applies commands
src/lib/domain/service.rs - Cache service → Repository port: appends mutations
src/lib/domain/service.rs - In-memory cache → TTL units: uses TTL units
src/lib/domain/cache.rs - Cache service → Persister: uses repository adapter
README.md - Persister → Repository port: implements port
src/lib/outbound/persister/mod.rs - Persister → Append-only log: appends and replays
src/lib/outbound/persister/mod.rs - Persister → Snapshot store: loads and stores
src/lib/outbound/persister/mod.rs - Persister → File handle: opens file handles
src/lib/outbound/persister/persister_inner.rs - Append-only log → RESP framing: reuses frame codec
src/lib/outbound/persister/aof.rs - Append-only log → Command codec: reuses command parser
src/lib/outbound/persister/aof.rs - Snapshot store → In-memory cache: serializes cache state
src/lib/outbound/persister/snapshot.rs - Client session → Reply mapping: maps command outcomes
src/lib/inbound/mod.rs - Reply mapping → Reply codec: constructs RESP replies
src/lib/inbound/mod.rs - Client session → Reply codec: encodes replies
- Reply codec → Redis client: returns RESP bytes
- TCP server → In-memory cache: sweeps expired keys
src/lib/domain/cache.rs - TCP server → Persister: recovers and snapshots
src/lib/inbound/server.rs