Opening Scenario
You're building an e-commerce platform. When a user places an order, you need to: deduct inventory, charge the payment method, send a confirmation email, notify the warehouse, and update the analytics dashboard. Your first implementation puts all of this in a single placeOrder() function that calls each service sequentially. It works — until the email service goes down for 10 minutes and every order fails. Then the warehouse integration is slow and order latency jumps to 8 seconds. Then marketing wants to add loyalty point accrual and you have to deploy the order service again.
Every new requirement makes the order service more fragile and more coupled.
Question Progression
1. What's the fundamental coupling problem?
Question: When placeOrder() calls sendEmail() directly, what happens if sendEmail() is slow or unavailable?
Reasoning: In a direct call model, the caller waits for the callee to respond. The order service's success is bound…
In the full tutorial
- When to Reach for Event-Driven Architecture