Event-driven architecture
On this page 9 topics
Overview
Topics
- Event contracts
- event ownership
- schema evolution
- replay
Learn first
4 h of practice (estimate)
Learning outcomes
- Design event contracts (notification vs state transfer vs domain events) for consumers in other teams.
- Assign event ownership and publish an event catalog.
- Evolve schemas across teams with compatibility rules and versioned topics.
- Plan replay and backfill of events safely, including for consumers with side effects.
Lessons
Lab and exercises
Lab
SRB-002-LAB1 · Integration events
Outcomes: 1, 2, 3, 4 · Time: ~4 h
- List the business facts exchanged between Shop and FulfillCo (OrderReadyForFulfillment, ShipmentDispatched, ...).
- Define schemas, owners, topics, and compatibility rules for each.
- Write replay rules, flagging consumers with side effects.
- 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
| ID | Outcome | Task |
|---|---|---|
| SRB-002-EX01 | 1 | Classify three proposed events (OrderUpdated row dump, OrderPlaced, ShipmentDelayed ping) as notification, state transfer, or domain event. |
| SRB-002-EX02 | 1 | Write the OrderReadyForFulfillment schema for the warehouse team with privacy in mind. |
| SRB-002-EX03 | 2 | Who owns ShipmentDispatched? Write the catalog entry. |
| SRB-002-EX04 | 3 | A team wants to rename carrierCode to carrier. Describe the migration. |
| SRB-002-EX05 | 4 | Plan a backfill of 90 days of events to a new analytics consumer. |
| SRB-002-EX06 | 4 | Review 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.
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).