Kafka: Siege
Partitions, replication, consumer groups, Streams, KRaft and disaster recovery.
- waves
- 31
- chapters
- 5
- lines of code
- 0
Playable systems tutorials
Watch Kafka and Redis hold and break, in your browser. No code. First chapter free, €39 once for everything.
Proposed by your AI
The topic has two partitions. Consumers were lagging, so I added a third.
Right.House of cards. Within a group each partition has one owner, so the third consumer sits idle. Play Kafka
Payments: replication factor 3, min.insync.replicas=2, acks=all, idempotence on.
Right.This one holds. A write needs two copies before it is acknowledged, retries cannot duplicate it, and the topic stays writable with one broker down. Play Kafka
On a cache miss, each request loads the product from the database.
Right.House of cards. A thousand readers missing the same key become a thousand identical queries at once. Play Redis
Balances get their own instance with noeviction. The cache gets allkeys-lru.
Right.This one holds. Eviction policy is set per instance, so the cache can never push out a balance. Play Redis
A consumer crashes mid-batch. Does the work run twice?
It can. Commit after processing and a crash replays whatever was not committed yet: at-least-once. Commit before and that work is skipped instead. Kafka cannot take a side effect back, so make it safe to repeat. Wave 5: Crash Course
How do you keep each user’s events in order?
Key them by user. The key picks the partition, and Kafka keeps order within a partition. The price is load: a celebrity’s key puts all of its traffic on one partition. Wave 7: Celebrity Effect
How does the cache stay in sync with the database?
Not by itself: Redis never hears that the database changed. With cache-aside the application deletes or refreshes the key when it writes, and a TTL caps how stale a missed update can get. Lesson 4: Cache Gate
Every like hits one counter. Why didn’t more servers help?
A key lives on one instance and all of its commands run there, so extra servers and connections never split it. Batch the increments, or split the counter and add up the parts, giving up one atomic total. Lesson 14: One Hot Key
| You make the call | You see it under load | Failures on demand | A mistake costs | |
|---|---|---|---|---|
| Docs and books | No | No | No | Nothing |
| Videos and talks | No | Someone else’s demo | No | Nothing |
| Lectures and courses | No | No | No | Nothing |
| Asking an AI | No | No | No | Found in production |
| A local cluster | Yes | If you script it | Some | An afternoon |
| On the job | Yes | Yes | When they happen | An outage |
| fivenines.dev | Yes | Yes | Yes | A retry |
In 225 studies of university science courses, lecture-only students were 1.5× as likely to fail as those who worked the material themselves. Freeman et al., PNAS, 2014 · Full text
Read the docs for the details. Play to make them stick.
Animation. A service contract of four goals hangs over an empty cluster. Brokers rise to meet it while the budget drains. A wave of traffic runs through, one zone goes dark and its partitions fail over to the other two. The contract comes back as the debrief, with every goal met.
Throughput, deadline, durability, budget.
Brokers, replicas, eviction, persistence. Everything costs.
Traffic and failures arrive on schedule.
Measured against every goal. Miss one and retry.
Partitions, replication, consumer groups, Streams, KRaft and disaster recovery.
Caching, eviction, persistence, Sentinel, Cluster, Streams and search.
€39 once unlocks every tutorial, new ones included. Chapter 1 of each is free. Pricing
I spent years at Uber on systems that had to stay up. The docs never taught me how they worked; making calls and watching what happened did. Now AI makes those calls in seconds. Someone still has to know if they will hold. I built fivenines.dev so that someone can be you.
Nick K.Founder · ex-Uber
About us
No. You make the calls an engineer makes (how many partitions, which eviction policy, where the replicas go) and the simulation shows what happens.
Engineers who ship with AI and want to judge what it builds, and engineers preparing for system design interviews. You need to be able to program. You do not need Kafka or Redis experience. Who it’s for
With the parts about queues, caches and replication, yes. Interviewers ask what happens when a consumer crashes, a key gets hot or a replica falls behind; each of those is a lesson you play and watch. It does not coach the interview itself. Lessons for interviews
No. They are deterministic models built from the official documentation, with numbers scaled to game units. Each tutorial lists what it models and what it leaves out.
Kafka is 31 waves. Redis is 54 lessons, designed to take 8–12 hours. Progress saves to your account, so you can stop anywhere and carry on on another device.
Yes, for every tutorial, the free chapters too. It is free and has no password: sign in with Google, or with a link by email. Your progress is saved to it, so it follows you to any browser.
Chapter 1 of every tutorial is free with a free account. One payment of €39, VAT included, unlocks everything, including tutorials added later. No subscription. What each chapter includes
Yes, but there is a lot to look at. A laptop is better.