CSE Roadmap

Specialist tier · about 2 hours · 6 parts

Part 2 of 6 · 1 min read

Events, producers, consumers

Think of an event stream like a newswire ticker. Reporters file short, timestamped stories as they happen, and anyone with a receiver can read each story the moment it appears, instead of waiting for tomorrow's printed paper.

In plain words: An event is a small, self-contained, immutable record of something that happened at a point in time, usually carrying a timestamp. A producer generates events and sends them out; a consumer receives and processes them. Related events are grouped into a topic. Polling a database for new rows works for occasional checks, but polling more often to reduce delay wastes effort, because most polls return nothing new. A system built for streaming instead notifies a consumer the moment a new event exists, rather than making it ask repeatedly.

A worked example. Every time a customer views a book's page, the bookstore's web server emits an event: {book_id, customer_id, viewed_at}. A recommendation service and a trending-books service both consume that same event stream, each doing its own thing with it, without either one touching the original orders database.

The key lines. No new SQL; an event here is a message, not a database row.

{"book_id": 4821, "customer_id": 501, "viewed_at": "2026-11-19T10:03:12Z"}

Event, producer, consumer, topic

An event is a small, immutable, timestamped record of something that happened. A producer is the party that generates and sends events; a consumer is the party that receives and processes them. A topic is a named stream grouping together related events.

Example: the page-view event above belongs to a "page-views" topic, produced by the web server and consumed by the recommendation service.