Problem Statement
You must notify search, analytics, and email when an order is placed. Describe two fan-out strategies and trade-offs.
Explanation
Broker fan-out publishes a single event to a topic which multiple consumer groups read independently. It is simple, scalable, and supports replay. The trade-off is eventual consistency and independent failure domains that you must monitor.
Application fan-out has the service call each downstream synchronously. It gives immediate feedback but couples latency and availability. A middle ground is to publish once and have a small orchestrator for time-critical side effects.
Code Solution
SolutionRead Only
publish(order.created); // groups: search, analytics, email
Practice Sets
This question appears in the following practice sets:
