The scenario used everywhere
A partner system sends charges and payments for customer accounts. We store each one as a row in an append-only ledger, and an account's balance is charges - payments.
Networks fail, programs crash and partners resend. Every chapter shows one of those failures step by step, and the design choice that keeps the ledger correct. At the end, a reconciliation compares what the partner sent with what we stored, to prove it.
Choose a path
The RabbitMQ path
A message broker that routes messages to queues and forgets them once they're acknowledged.
How a message travels · Acks · Idempotency · Prefetch and order · Retries with delay queues · Poison messages, DLQ and redrive
The Kafka path
A distributed log where records stay put and each reader keeps its own bookmark.
A log, not a queue · Keys and order · Consumer groups · Committing offsets · acks and replicas · Exactly-once, honestly · Retries, DLQ, lag and replay
How each chapter works
1. Picture it
An everyday analogy before any jargon. Underlined terms show a definition on hover or tap.
2. Predict
A question about what will happen. Guessing first, even wrong, makes the answer stick.
3. Watch it happen
A step-by-step animation you control, with a narration of each step.
4. Go deeper
Why it matters, an interview-ready sentence, expert details, the matching lab code and links to the official docs.
RabbitMQ vs Kafka
| RabbitMQ | Kafka | |
|---|---|---|
| Model | Broker routes messages to queues; a message is deleted when acked. | Partitioned, replicated log; consumers track their position with offsets. |
| Ordering | Per queue, with a single consumer. | Per partition; key by entity. |
| Scaling | Competing consumers on a queue; prefetch limits unacked messages. | Partitions are the unit of parallelism; one partition per consumer in a group. |
| Retries | Delay queues (TTL + dead-letter exchange) or the delayed-message plugin; DLQ. | Short blocking retries keep order; retry or DLQ topics for longer ones. |
| Replay | Acked messages are gone: redrive the DLQ or ask the source to resend. | Move the group's offsets back; safe if consumers are idempotent. |
| Health metric | Queue depth, unacked count, DLQ depth. | Consumer lag per partition, DLQ volume. |
| Good for | Work queues, routing, per-message handling. | Event streams, many independent consumers, history and replay. |
Run the real labs
The simulators are teaching models. The repo contains two runnable labs with real brokers, Postgres and Python consumers, each with 7 to 8 exercises.
In the browser (no install): click Open in Codespaces. Docker, Python and the dependencies are set up for you. Then:
cd rabbitmq-lab && docker compose up -d # RabbitMQ UI on port 15672 # or cd kafka-lab && docker compose up -d && python create_topics.py # Kafka UI on port 8080
On your machine: Docker Desktop and Python 3.11+, then follow each lab's README.
Run one lab at a time in a Codespace to keep memory comfortable.
Run the real labs
The animations are teaching models. The repo has two runnable labs with real brokers, Postgres and Python consumers.
In the browser (no install): open in GitHub Codespaces, then follow the README.
On your machine: Docker Desktop and Python 3.11+, then each lab's README.