Learning / Events / Chapter 1

Event Basics

Why “this happened” often beats “do this now”

Events, publish/subscribe and message brokers explained visually, and when events are the better choice than synchronous REST calls.

Intermediate · 9 slides · 8 min

  1. What is an event?

    An event is a fact: something happened. Named in the past tense (OrderPlaced, UserRegistered) and never changed afterwards.

  2. Calling everyone directly

    When one service calls all others synchronously, one failure can break everything, and the customer waits for all of them.

  3. Publish & subscribe

    The sender publishes one event to a broker. Every interested service subscribes and gets its own copy. New ones can join any time.

  4. Event brokers

    Kafka, RabbitMQ, cloud services, Salesforce Platform Events and webhooks: the post offices between systems.

  5. When a service goes down

    If a subscriber is offline, events wait safely in the queue and are processed as soon as it is back.

  6. The trade-offs

    Eventual consistency, duplicates, harder debugging and one more system to run: what events cost.

  7. Events or REST?

    Use a synchronous call when you need the answer to continue, and an event when others just need to know.

  8. Check yourself

    What should happen after a customer registers?

  9. Recap

    Events, publish/subscribe, brokers and trade-offs: event-driven systems in five sentences.