Module 94: Distributed Systems

Lesson 2 of 5 · 15–25 minutes

Events

🏠The everyday picture

A newspaper is printed once and read by anyone who subscribes. The newspaper doesn't need to know its readers; new readers can subscribe at any time without changing how it's printed.

📘What it really is

🖱️Try it

Write an event catalogue for the booking platform: each event's name, version, fields, publisher and consumers. Change your Module 93 outbox worker to publish events to a pub/sub channel (Redis streams, or a simple table that several consumers read with their own "last seen" position). Add a new analytics consumer without touching the publisher, and test duplicate and out-of-order delivery.

✅Quick check

What's the main benefit of publish/subscribe?

Show the answer

New consumers can react to events without the publisher changing or even knowing about them.

Why shouldn't you rename fields in an existing event?

Show the answer

Existing consumers depend on them and would break; add new fields or version the event instead.

← PreviousQueues
ProLearners Assist