Skip to content
Ameen Abozaid
SRB-002

Event-driven architecture

  • 7 Lessons
  • 4 h practice (estimate)
On this page 9 topics

Overview

Topics

  • Event contracts
  • event ownership
  • schema evolution
  • replay

Learn first

4 h of practice (estimate)

Learning outcomes

  1. Design event contracts (notification vs state transfer vs domain events) for consumers in other teams.
  2. Assign event ownership and publish an event catalog.
  3. Evolve schemas across teams with compatibility rules and versioned topics.
  4. Plan replay and backfill of events safely, including for consumers with side effects.

Lessons

  1. 01Event-driven architecture at organization scale
  2. 02Kinds of events and when to use each
  3. 03Ownership and event catalogs
  4. 04Schema evolution across teams
  5. 05Replay and backfill
  6. 06Demo: designing the Shop ↔ FulfillCo event contract
  7. 07Demo: a replay that would have resent 40,000 emails, and the fix

Lab and exercises

Lab

SRB-002-LAB1 · Integration events

Outcomes: 1, 2, 3, 4 · Time: ~4 h

  1. List the business facts exchanged between Shop and FulfillCo (OrderReadyForFulfillment, ShipmentDispatched, ...).
  2. Define schemas, owners, topics, and compatibility rules for each.
  3. Write replay rules, flagging consumers with side effects.
  4. Hold a review with two role-played consuming teams and record their changes.

Acceptance: catalog reviewed by two role-played consuming teams; each event has owner, schema, and replay rule.

Exercises

IDOutcomeTask
SRB-002-EX011Classify three proposed events (OrderUpdated row dump, OrderPlaced, ShipmentDelayed ping) as notification, state transfer, or domain event.
SRB-002-EX021Write the OrderReadyForFulfillment schema for the warehouse team with privacy in mind.
SRB-002-EX032Who owns ShipmentDispatched? Write the catalog entry.
SRB-002-EX043A team wants to rename carrierCode to carrier. Describe the migration.
SRB-002-EX054Plan a backfill of 90 days of events to a new analytics consumer.
SRB-002-EX064Review a consumer that charges cards on PaymentRequested. Is replaying the topic safe?
Show solutions
  • EX01 Row dump: leaked internal state; OrderPlaced: domain event; ping: notification. Redesign the row dump as a domain event.
  • EX02 Order id, line items with SKU and quantity, promised date, minimal delivery reference; no payment data.
  • EX03 FulfillCo-shipping; entry with topic, schema, sensitivity, consumers, replay-safe flag.
  • EX04 Add the new optional field, publish both, migrate consumers, deprecate with a date, then remove in a new version.
  • EX05 Throttle, use a separate consumer group, idempotent writes, verify counts, no side effects.
  • EX06 No; require idempotency keys at the payment provider and a processed-event table.

Workplace evidence: an event contract you designed that another team consumes.

Quiz

Outcomes: O1 contracts · O2 ownership and catalog · O3 schema evolution · O4 replay and backfill.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1Event-carried state transfer means the event:O1
  2. 2A good domain event name is:O1
  3. 3Leaking internal models as events causes:O1
  4. 4Event ownership belongs to:O2
  5. 5An event catalog should record:O2
  6. 6Which change is backward compatible?O3
  7. 7A breaking change is best released as:O3
  8. 8Replay danger arises mostly from:O4
  9. 9A safe replay for an email consumer uses:O4
  10. 10Backfills should be:O4

Practical part

Contract review: review a peer's event contract against the checklist. Pass: 70% on the quiz and a review that finds at least three real issues in a flawed contract.

Common mistakes

Leaking internal models as events; replays that resend customer emails.

Assessment

Contract review.

Workplace evidence

An event contract you designed that another team consumes.

Career relevance

Event architecture (ARC-026).

Type to search levels, phases, modules and lessons.