A high-performance in-memory cache engine built on Zig & Bun
O(1) operations ยท native LRU eviction ยท bloom filter ยท real-time WebSocket streaming ยท Prometheus metrics
# Clone and start
git clone https://github.com/owenbellowen/dunena.git
cd dunena
bun run build:zig
bun run start
# Set a value
curl -X POST http://localhost:3000/cache/hello \
-H "Content-Type: application/json" \
-d '{"value": "world"}'
# Get it back
curl http://localhost:3000/cache/hello
Native O(1) cache operations via hash map + doubly-linked list LRU. Called through Bun's zero-cost FFI bridge.
GET, SET, DELETE with namespace isolation. Batch mget/mset for efficient multi-key operations.
Probabilistic membership test eliminates unnecessary hash lookups on cache misses. Configurable false-positive rate.
Per-key time-to-live with automatic cleanup. Set a default TTL or override per request.
Subscribe to cache events. Run get/set/del/mget/mset over WebSocket with namespace and TTL support.
/metrics endpoint with hits, misses, evictions, hit rate, latency percentiles, and uptime.
Built-in web dashboard with live stats, cache operations panel, key scanner, and event log.
Full-featured command-line client: get, set, del, mget, mset, keys, stats, bench โ with namespace support.
Auto-compress large values using native Zig RLE. Configured via threshold โ zero-change reads.