fivenines

Redis Tutorials

Model Redis one mechanism at a time.

Each tutorial gives you a short mechanism brief, practice checks, a starter D2 model, and feedback on the system behavior you submit.

What a fivenines problem looks like

Each problem focuses on one Redis-like runtime mechanism. You read the short theory, check the key behavior in practice, then produce one concrete D2 artifact: a sequence diagram, state machine, flowchart, data model, or architecture diagram.

The structure is fixed so you can focus on the mechanism instead of decoding the prompt. Every problem ships with a brief, requirements, constraints, starter files, hints, and a review rubric. Feedback points to missing runtime paths, broken invariants, and the next concrete revision.

Artifact types you will produce

  • Sequence diagrams — trace a client command through parsing, execution, persistence, replication, or cluster routing.
  • State machines — make parser states, transaction states, and failover transitions explicit.
  • Flowcharts — model command dispatch, expiration, eviction, and other branch-heavy paths.
  • Data models — show keyspace ownership, object metadata, dictionaries, logs, slots, and indexes.
  • Architecture diagrams — compose learned subsystems without hiding the runtime path.

How feedback works

AI feedback checks your D2 source against the tutorial rubric and tells you what holds up, what is missing, and what breaks. The goal is not a generic grade; it is a sharper model of how Redis works inside.

foundation20m

Model Single-Node Key-Value Core

Model shared keyspace changes for SET, GET, and DEL in a Redis-like system.

rediskey-valuecommandshash-tabled2
foundation20m

Model RESP Protocol Parser

Model valid, incomplete, and invalid RESP parsing in a Redis-like system.

redisrespprotocolparserd2
foundation25m

Model Client Connection Lifecycle

Model per-client input, output, mode, and cleanup state in a Redis-like system.

redisconnectionsbufferstcpd2
foundation25m

Model Event Loop

Model one event-loop turn across file readiness and time events in a Redis-like system.

redisevent-loopreactortimersd2
foundation25m

Model Command Table And Dispatch

Model metadata-driven command dispatch before handler execution in a Redis-like system.

rediscommand-tabledispatchvalidationd2
foundation20m

Model Redis Object Model

Model logical type, physical encoding, and object metadata in a Redis-like system.

redisobjectstypesencodingsd2
foundation25m

Model Hash Table And Rehashing

Model two-table incremental rehashing behavior in a Redis-like system.

redishash-tablerehashingdictionaryd2
foundation25m

Model Expiration System

Model expiration metadata plus passive and active deletion in a Redis-like system.

redisttlexpirationsamplingd2
foundation25m

Model Memory Limits And Eviction

Model maxmemory eviction decision flow in a Redis-like system.

redismaxmemoryevictionlrulfud2
foundation25m

Model Core Data Types

Model Redis type choice from access patterns in a Redis-like system.

redislistshashessetssorted-setsd2
intermediate25m

Model Pipelining And Output Buffers

Model transport batching, ordered replies, and partial writes in a Redis-like system.

redispipeliningoutput-buffersbackpressured2
intermediate30m

Model Transactions

Model per-client MULTI/EXEC queuing and WATCH invalidation in a Redis-like system.

redistransactionswatchoptimistic-concurrencyd2
intermediate25m

Model Scripts/functions

Model atomic server-side code execution and deterministic propagation in a Redis-like system.

redisscriptsfunctionsatomic-executiond2
intermediate25m

Model Pub/Sub

Model live Pub/Sub fanout without durable storage in a Redis-like system.

redispub-subchannelsfanoutd2
intermediate30m

Model Streams

Model streams as replayable logs with consumer group pending state in a Redis-like system.

redisstreamsconsumer-groupspending-entriesd2
intermediate30m

Model RDB Snapshotting

Model point-in-time RDB snapshotting with copy-on-write in a Redis-like system.

redisrdbsnapshotcopy-on-writed2
intermediate30m

Model AOF Persistence

Model AOF durability timing and rewrite compaction in a Redis-like system.

redisaoffsyncrewrited2
intermediate30m

Model Startup Recovery

Model startup rebuild from RDB or AOF before normal traffic in a Redis-like system.

redisrecoveryrdbaofreplayd2
advanced30m

Model Replication: Full Sync

Model full sync using a snapshot plus writes after the snapshot point in a Redis-like system.

redisreplicationfull-syncprimary-replicad2
advanced30m

Model Replication: Partial Sync

Model partial sync using replication ID, offset, and backlog range in a Redis-like system.

redisreplicationpsyncbacklogd2
advanced30m

Model Failover Controller

Model distributed failover decision, promotion, epochs, and reconfiguration in a Redis-like system.

redisfailoversentinelquorumd2
advanced30m

Model Cluster Sharding

Model cluster slot routing, MOVED, and cross-slot rejection in a Redis-like system.

redisclusterhash-slotsmovedd2
advanced30m

Model Cluster Resharding

Model temporary ASK routing while a slot is being migrated in a Redis-like system.

redisclusterreshardingaskd2
advanced30m

Model track Redis-Like System

Model the complete Redis-like command path with learned subsystems attached in a Redis-like system.

redistrackarchitectureintegrationd2