Skip to content

v1.0.0 - Core Engine, AOF Persistence & Graceful Shutdown

Choose a tag to compare

@boldbug1 boldbug1 released this 13 Sep 14:37
· 4 commits to main since this release
df0fbee

Initial release of tiny-redis, a lightweight in-memory key-value database written in Go implementing core Redis internals and protocol serialization.

Features

  • Network & Concurrency: Multi-client TCP server utilizing a goroutine-per-connection model with thread-safe data access via sync.RWMutex.
  • Wire Protocol: Handcrafted Redis Serialization Protocol (RESP) deserializer reading binary-safe bulk string arrays directly from buffered network streams (bufio.Reader).
  • Storage & Operations: In-memory storage supporting PING, ECHO, SET, GET, DEL, EXPIRE, and TTL.
  • Two-Tier Eviction:
    • Passive: On-access validation during reads to evict stale entries immediately.
    • Active: Probabilistic background sweeper running on a 100ms ticker with an adaptive 25ms execution cap.
  • AOF Persistence: Mutating operations are logged to appendonly.aof using raw RESP format and deterministically replayed on server startup.
  • Graceful Shutdown: Traps SIGINT/SIGTERM via channels to cleanly exit the connection accept loop, flush unwritten kernel page buffers to disk via fsync, and close file descriptors.