{"repo":"Aditya-1304/kvred","free":true,"listed":false,"github":"https://github.com/Aditya-1304/kvred","clone":"git clone https://github.com/Aditya-1304/kvred.git","description":"Redis-compatible in-memory key-value server in Rust with RESP2, AOF persistence, recovery, and configurable durability (fsync) policies.","language":"Rust","stars":18,"topics":["database","redis"],"license":null,"category":"databases-storage","readme_excerpt":"kvred kvred is a Redis-compatible string key-value server written in Rust with Tokio. It speaks RESP2 over TCP, keeps hot state in memory, persists mutating commands to an append-only file (AOF), replays the AOF on startup, supports log compaction through AOF rewrite, and shuts down gracefully. The project is intentionally scoped as a systems-learning implementation rather than a full Redis replacement. It focuses on protocol correctness, write ordering, recovery, and durability trade-offs. Scope kvred implements a strict v1 contract: - RESP2 only - Binary-safe string keys and values - Commands: PING , GET , SET , DEL , EXISTS - In-memory serving state backed by HashMap - AOF persistence for mutating commands - AOF replay on startup - AOF rewrite / compaction - Graceful shutdown with writer drain and final sync Out of scope: - TTL and expiration - Eviction - Transactions - Replication - Pub/Sub - Lua scripting - Clustering - RESP3 Architecture The server is split into five main subsystems. 1. Protocol layer The protocol layer parses and encodes RESP2 frames. - src/protocol/decode.rs - src/protocol/encode.rs - src/protocol/frame.rs It handles: - partial reads - multiple frames in a single buffer - bulk strings and arrays - binary-safe payloads 2. Command layer The command layer converts decoded RESP arrays into typed commands and executes them against storage. - src/command/parse.rs - src/command/exec.rs Command parsing is separated from protocol parsing on purpose: - protocol","default_branch":null,"files":null,"tree":[],"storefront":"/r/Aditya-1304","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Aditya-1304/kvred/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}