🏗️Event-Driven Architecture
Also known as EDA, Event-Driven Design, Event-Based Architecture
Parts of a system talk by sending out events. Other parts react to them.
Think of it like
Think of it like a school bell. When it rings, each class knows what to do next.
Example
When Lucy's shop gets an order, it sends an order placed event. The email service sends a receipt and the stock service lowers the count. Neither was called directly.
Why it matters
New parts can join by listening for events. The code that sends them does not change.
Definition
Common mistake
Key takeaways
- 1Announce, do not call. Something happened.
- 2Many can react. Sender does not know who.
- 3Harder to trace. Keep a map.