/ddia

Playground to practice "Designing Data-Intensive Applications" concepts

Primary LanguageGo

Designing Data-Intensive Applications

This repository is a playground where I implement ideas from the book Designing Data-Intensive Applications.

NOTE 2023-01-31: I've finished playing around with the project. In wrapping-up.md you will find the conclusions and what I've learnt. It has been a very nice project. I strongly recommend it to anyone 🚀

Objective

Implement Redis 1.0 command set (see commands.md) for educative purposes, without any external dependency (empty go.mod).

Design

This project will implement a Redis Server using the Redis Serialization Protocol.

Objectives

  • Setup
    • The server must be able to "talk" with original redis-cli and redis-benchmark tools, behaving as a real server.
    • Gracefully shutdown of the server
    • Do not close the connection on each command
    • Store values in-memory in a key-value store (map + mutexes)
    • Benchmark the key value store and compare it with Redis
    • OOM management. Invalidate older keys or swap to disk
  • Storage
    • Persist using Append Only File
    • Write to the WAL before sending OK confirmation to the client
    • Be able to restart the server and keep the state (even after crash)
    • Persist using point-in-time Snapshots
  • Features
    • Implement expire commands (set a TTL for a key)
  • Replication
    • Read-Only replica support
  • TTL: Implement expiration mechanism

Secondary objectives

Commands supported

See commands.md to know what commands have been implemented and what's the progress.