$ show barddoo/zedis
Zedis is a high-performance, Redis-compatible in-memory data store written in Zig. It implements the RESP protocol and supports core Redis data structures (strings, lists, TTL, pub/sub) along with advanced features: time-series with Gorilla compression, full-text search with BM25 and vector KNN (FLAT), probabilistic Bloom filters, and both AOF and RDB persistence. The architecture uses a multi-threaded server with a dedicated store thread for serialized command execution, custom budgeted allocators, and a lock-free client mailbox for message passing. While production-ready in capability, the project is explicitly designed for learning and experimentation and shows some documentation-to-code drift and a handful of unmaintained TODO items. It includes an extensive benchmark suite comparing against Valkey.
The LLM identified 3 files worth highlighting for reuse:
A stack-allocated writer that transparently overflows to a heap-allocated buffer when the stack buffer is exhausted. Used for efficient RESP response serialization without dynamic allocation for typical message sizes. This component is self-contained, has no internal dependencies, and can be reused in any Zig project requiring a low-allocation output buffer.
A cached monotonic timestamp that reduces system call overhead by updating the cached value only after a configurable interval (default 1ms). Falls back to direct OS clock calls when the cache is stale. Pure time utility with no project-specific coupling, easily extractable for any Zig application that needs high-frequency timestamp queries.
An implementation of Facebook's Gorilla time-series compression algorithm for 64-bit floating-point values. Contains both compressor and decompressor using a custom BitStream for efficient bit-level I/O. The component is modular, depends only on standard library types, and can be extracted as a standalone Zig module for compressing/decompressing streaming double-precision time-series data.