How sarthak-shubham/cherry works
Cherry is a single-node persistent key-value store. CLI commands send HTTP requests to the server, which routes GET, PUT, and DELETE operations to the concurrent in-memory store; writes append to the WAL before changing memory. At startup, main replays the WAL to rebuild the map before serving requests. The graph follows those documented and excerpted paths; it omits test and build machinery.
Main entry points: main.go Startup orchestration · methods.go Concurrent operations · server.go HTTP server · cli.go CLI commands
Components 11
Application entrypoints
- CLI commands
client/cli.go - HTTP client
client/client.go
HTTP API
- HTTP server
server/server.go - Request routing
server/handler.go - KV handlers
server/kv.go
Store and WAL
- Store state
store/store.go - Concurrent operations
store/methods.go - JSONL write-ahead log
persistence/persist.go
Startup recovery
- Startup orchestration
main.go - WAL replay
recovery/recover.go
Other components
- CLI user
Connections 12
- CLI user → CLI commands: runs commands
README.md - CLI commands → HTTP client: dispatches commands
client/cli.go - HTTP client → HTTP server: sends HTTP
README.md - HTTP server → Request routing: routes requests
server/server.go - Request routing → KV handlers: dispatches methods
server/handler.go - KV handlers → Concurrent operations: calls operations
server/kv.go - Concurrent operations → Store state: reads and updates
store/methods.go - Concurrent operations → JSONL write-ahead log: appends records
store/methods.go - Startup orchestration → WAL replay: recovers state
main.go - WAL replay → JSONL write-ahead log: reads records
README.md - Startup orchestration → Store state: creates store
main.go - Startup orchestration → HTTP server: starts server
main.go