If your system craves tight sync and predictability, microservices are your go-to. If you’re chasing flexibility, resilience, and component independence, events win.
Realistically, though, the sweet spot’s a hybrid. Critical requests—like auth or payments—should stick to APIs to dodge delays and duplicates. For secondary stuff—notifications, analytics, third-party integrations—a message broker’s your friend.
Amazon’s marketplace nails this combo. Place an order via REST API for instant confirmation, while processing is event-driven for flexibility:
- User submits order → order service saves it to the DB and confirms with the user.
- “Order created” event hits the bus.
- Payment service subscribes → charges the card.
- Logistics service subscribes → pings the warehouse.
- Notification service subscribes → emails the customer.
The takeaway? The bigger your system, the more events shine—but don’t ditch APIs entirely. The trick is not oversimplifying at the expense of scalability.