How abhinav5568/in_memory_kv_store works
This repository implements a TCP key-value cache server with per-user memory blocks, an LRU/TTL cache, and append-only persistence restored at startup. The main workflow is a client sending AUTH and cache commands to the server, which routes them to a user cache and logs mutations; startup replays those logs before listening. The README is empty, so the map is based on the shown source excerpts and SOURCE INDEX; test files and data fixtures are omitted.
Main entry points: server.js TCP Server · aof_bootstrap.js AOF Rehydration · connections.js Shared Connections · lru.js Per-user LRU Cache
Components 9
TCP Runtime
- KV Client
engine/lib/KVClient.js - TCP Server
engine/server.js
User Sessions
- Connection Manager
engine/connection_manager.js - Shared Connections
engine/init/connections.js
Cache Engine
- Per-user LRU Cache
engine/lru.js
Persistence
- AOF Logger
engine/aof_logger_engine.js - AOF Rehydration
engine/aof_bootstrap.js - AOF Files
engine/data
Other components
- Client App
Connections 12
- Client App → KV Client: uses
engine/lib/KVClient.js - KV Client → TCP Server: sends TCP frames
engine/lib/KVClient.js - TCP Server → Shared Connections: routes AUTH/INIT
engine/server.js - Shared Connections → Connection Manager: exports instance
engine/init/connections.js - Connection Manager → Per-user LRU Cache: creates per-user
engine/connection_manager.js - TCP Server → Per-user LRU Cache: executes commands
engine/server.js - TCP Server → AOF Logger: logs mutations
engine/server.js - AOF Logger → AOF Files: appends commands
engine/aof_logger_engine.js - TCP Server → AOF Rehydration: awaits startup replay
engine/server.js - AOF Rehydration → AOF Files: reads logs
engine/aof_bootstrap.js - AOF Rehydration → Shared Connections: restores user caches
engine/aof_bootstrap.js - AOF Rehydration → Per-user LRU Cache: replays mutations
engine/aof_bootstrap.js