Metadata Card
- Prerequisites: Chapter 15 (Data Consistency Patterns); Chapter 10 (Observer Pattern)
- Estimated Time: 45 minutes
- Core Difficulty: Advanced
- Completion Milestone: Design event-driven architecture and choose choreography/orchestration patterns
Your Progress
Your micro-engine architecture has been running for over half a year. Communication between engines is all synchronous magic pipes — Player Engine calls Match Engine, Match Engine waits for Score Engine's response. When Score Engine slows down, all dependents queue up.
The City of Artisans communications station has a new message board: post an announcement, whoever needs it reads it. No need for reply. Your Task
Beyond synchronous request-response, event-driven architecture offers looser coupling.
Required reading: Event Mesh basics, Choreography vs Orchestration Selective: Stream Processing concepts Advanced: Dead Letter & retry strategies
First Layer: Event Mesh
Infrastructure for event-driven architecture. More flexible than simple message queues — dynamic routing, filtering, transformation.
Second Layer: Choreography vs Orchestration
Choreography: each service independently listens and responds. Loosely coupled, implicit flow. Orchestration: central coordinator tells each service what to do. Explicit flow, central controller.
Third Layer: Stream Processing
Continuous computation on event streams. Real-time updates with stateful processing, exactly-once semantics.
Fourth Layer: Dead Letter & Retry
Failed events retry a few times, then go to a Dead Letter Queue for manual or automated handling. Monitor DLQ actively.
Common Pitfalls: Out-of-order events, circular events, event overload (not every state change needs an event).
Traveler's Notes
Event-driven changes "synchronous wait" to "asynchronous notification," changes "you call me" to "you publish, I subscribe." Choreography is loosely coupled but implicit, Orchestration is explicit but needs a coordinator.
Next: AI System Patterns (Chapter 18).