fivenines
All tracks

Build Your Own Redis

Next up20 min0% complete

Build Your Own Redis

Single-Node Key-Value Core

Show how in-memory get, set, del works inside a Redis-like server through one focused runtime path.

Tutorial progress0%
01

Single-node Core

0/1 done

Build command-owned in-memory key-value behavior before adding protocol or scheduling concerns.

001

redis single node key value core

Single-Node Key-Value Core

in memory data store / not specified

Show how in-memory get, set, del works inside a Redis-like server through one focused runtime path.

d2 hybridrediskey-valuecommands
20mpublishedBuild it
02

Network Protocol

0/2 done

Add byte framing and client connection lifecycle after command semantics are stable.

002

redis resp protocol parser

RESP Protocol Parser

in memory data store / not specified

Show how parse redis protocol requests and responses works inside a Redis-like server through one focused runtime path.

d2 state machineredisrespprotocol
20mpublishedBuild it
003

redis client connection lifecycle

Client Connection Lifecycle

in memory data store / not specified

Show how accept/read/execute/write flow works inside a Redis-like server through one focused runtime path.

d2 sequenceredisconnectionsbuffers
25mpublishedBuild it
03

Execution Core

0/2 done

Introduce the single-threaded reactor and metadata-driven command dispatch.

004

redis event loop

Event Loop

in memory data store / not specified

Show how single-threaded file and timer events works inside a Redis-like server through one focused runtime path.

d2 architectureredisevent-loopreactor
25mpublishedBuild it
005

redis command table dispatch

Command Table And Dispatch

in memory data store / not specified

Show how metadata-driven command execution works inside a Redis-like server through one focused runtime path.

d2 flowchartrediscommand-tabledispatch
25mpublishedBuild it
04

Data Model

0/3 done

Explain object representation, dictionary maintenance, and typed payloads one mechanism at a time.

006

redis object model

Redis Object Model

Pro

in memory data store / not specified

Show how typed values and encodings works inside a Redis-like server through one focused runtime path.

d2 data modelredisobjectstypes
20mpro onlyUpgrade
007

redis dictionary rehashing

Hash Table And Rehashing

Pro

in memory data store / not specified

Show how main dictionary and incremental rehash works inside a Redis-like server through one focused runtime path.

d2 hybridredishash-tablerehashing
25mpro onlyUpgrade
010

redis core data types

Core Data Types

Pro

in memory data store / not specified

Show how lists, hashes, sets, sorted sets works inside a Redis-like server through one focused runtime path.

d2 hybridredislistshashes
25mpro onlyUpgrade
05

Memory Lifecycle

0/2 done

Separate time-based expiration from memory-pressure eviction.

008

redis expiration system

Expiration System

Pro

in memory data store / not specified

Show how passive and active key expiration works inside a Redis-like server through one focused runtime path.

d2 flowchartredisttlexpiration
25mpro onlyUpgrade
009

redis memory limits eviction

Memory Limits And Eviction

Pro

in memory data store / not specified

Show how maxmemory and eviction policies works inside a Redis-like server through one focused runtime path.

d2 flowchartredismaxmemoryeviction
25mpro onlyUpgrade
06

Command Behavior

0/5 done

Add queued, atomic, fanout, and log-like command behaviors after core data types exist.

011

redis pipelining output buffers

Pipelining And Output Buffers

Pro

in memory data store / not specified

Show how many queued requests and large responses works inside a Redis-like server through one focused runtime path.

d2 sequenceredispipeliningoutput-buffers
25mpro onlyUpgrade
012

redis transactions watch

Transactions

Pro

in memory data store / not specified

Show how multi, exec, discard, watch works inside a Redis-like server through one focused runtime path.

d2 state machineredistransactionswatch
30mpro onlyUpgrade
013

redis scripts functions

Scripts/functions

Pro

in memory data store / not specified

Show how atomic server-side execution works inside a Redis-like server through one focused runtime path.

d2 sequenceredisscriptsfunctions
25mpro onlyUpgrade
014

redis pub sub

Pub/Sub

Pro

in memory data store / not specified

Show how channels, patterns, publish fanout works inside a Redis-like server through one focused runtime path.

d2 architectureredispub-subchannels
25mpro onlyUpgrade
015

redis streams consumer groups

Streams

Pro

in memory data store / not specified

Show how append-only stream and consumer groups works inside a Redis-like server through one focused runtime path.

d2 hybridredisstreamsconsumer-groups
30mpro onlyUpgrade
07

Persistence

0/3 done

Persist and rebuild the in-memory database with snapshots and append-only history.

016

redis rdb snapshotting

RDB Snapshotting

Pro

in memory data store / not specified

Show how point-in-time persistence works inside a Redis-like server through one focused runtime path.

d2 sequenceredisrdbsnapshot
30mpro onlyUpgrade
017

redis aof persistence

AOF Persistence

Pro

in memory data store / not specified

Show how append-only log and rewrite works inside a Redis-like server through one focused runtime path.

d2 sequenceredisaoffsync
30mpro onlyUpgrade
018

redis startup recovery

Startup Recovery

Pro

in memory data store / not specified

Show how restore from rdb/aof works inside a Redis-like server through one focused runtime path.

d2 flowchartredisrecoveryrdb
30mpro onlyUpgrade
08

Replication And Failover

0/3 done

Copy state to replicas, resume streams, and promote safely after failure.

019

redis replication full sync

Replication: Full Sync

Pro

in memory data store / not specified

Show how initial master-replica sync works inside a Redis-like server through one focused runtime path.

d2 sequenceredisreplicationfull-sync
30mpro onlyUpgrade
020

redis replication partial sync

Replication: Partial Sync

Pro

in memory data store / not specified

Show how replication ids, offsets, backlog works inside a Redis-like server through one focused runtime path.

d2 flowchartredisreplicationpsync
30mpro onlyUpgrade
021

redis failover controller

Failover Controller

Pro

in memory data store / not specified

Show how sentinel-like monitoring and promotion works inside a Redis-like server through one focused runtime path.

d2 state machineredisfailoversentinel
30mpro onlyUpgrade
09

Clustering

0/2 done

Split key ownership across nodes and move ownership online.

022

redis cluster sharding

Cluster Sharding

Pro

in memory data store / not specified

Show how hash slots and moved redirects works inside a Redis-like server through one focused runtime path.

d2 gridredisclusterhash-slots
30mpro onlyUpgrade
023

redis cluster resharding

Cluster Resharding

Pro

in memory data store / not specified

Show how live slot migration and ask works inside a Redis-like server through one focused runtime path.

d2 sequenceredisclusterresharding
30mpro onlyUpgrade
10

Capstone

0/1 done

Compose the learned Redis-like mechanisms without introducing new core concepts.

024

redis track system

track Redis-Like System

Pro

in memory data store / not specified

Show how full integrated design works inside a Redis-like server through one focused runtime path.

d2 hybridredistrackarchitecture
30mpro onlyUpgrade