Skip to main content
System Design

Event-Driven Architecture Tutorial with Examples.

Event-driven architecture tutorial: event sourcing, CQRS, message brokers, choreography vs orchestration and the outbox pattern.

Beginner

Start here — no prior experience needed

3 lessons

Intermediate

For developers with core concepts down

6 lessons
event-driven intermediate
5 min read

Replaying 200,000 events gets measurably slower as a log grows; a snapshot resumes from a known balance and replays only what changed since.

event-driven intermediate
5 min read

A denormalized read model only reflects the write log once a projector actually processes new events — real output showing that lag, and closing it.

event-driven intermediate
5 min read

Committing an order and publishing its event are two separate calls that can fail independently, and the gap between them can silently drop data.

event-driven intermediate
5 min read

Writing the event to the same database transaction as the data closes the dual-write gap; a relay then publishes it, at least once.

event-driven intermediate
5 min read

The outbox pattern can deliver the same event twice; a consumer that tracks processed event IDs stays correct even when it does.

event-driven intermediate
5 min read

A consumer retrying a poison message forever wastes work on something that will never succeed — route it to a dead-letter queue, then replay once fixed.

Advanced

Production-grade patterns for experienced engineers

1 lesson

Also part of Event-Driven Architecture

Taught in other topics. Each link opens the lesson in its home topic.

6 lessons
microservices intermediate
5 min read

No single database transaction spans order, payment, and inventory services — a saga orchestrator runs each step in order and tracks what's completed.

microservices advanced
5 min read

The same orchestrator, now with a deliberate mid-sequence failure — real output showing exactly which completed steps get rolled back, and in what order.

kafka intermediate
5 min read

Reproduce message loss and duplication on purpose, then configure the producer and consumer to get each of Kafka's three delivery guarantees.

kafka intermediate
5 min read

Break a consumer by changing a JSON field, then fix it properly with Avro and a Schema Registry that rejects incompatible changes before they ship.

redis intermediate
5 min read

Publishing to a channel with no subscribers doesn't queue the message for later — it's just gone. Real fan-out to multiple subscribers, pattern subscriptions, and sharded Pub/Sub follow.

data-engineering intermediate
5 min read

Four ways to extract only what changed, why deletes are the hard part, and building SCD type 2 history from a CDC stream that arrives out of order.