Back to Catalog
Integration
Message Routing
Scatter-Gather
Blast a request to N services in parallel, collect all responses, pick the best.
Intent & Description
Real-world Use Case
Flight search — query sent to 8 airline APIs simultaneously. Each returns available flights. Aggregator collects responses for 3 seconds, then emits a combined FlightSearchResults message. Slowest airline misses the cutoff but the user still gets results fast from the 7 that responded.
Source
📌 TL;DR
Scatter-Gather = fan out to N services in parallel, collect all responses, return the combined best. The fastest way to aggregate results from multiple independent sources.
Advantages
- Maximum parallelism — all recipients process simultaneously
- Timeout-based gather gives results even if some recipients are slow
- Clean separation of scatter (broadcast) and gather (aggregate) concerns
- Best-of-N selection — pick the fastest, cheapest, or most relevant result
Disadvantages
- All recipients get the request regardless of relevance — can cause load
- Aggregation complexity — partial results, timeout handling, result ranking
- Correlation ID management across N concurrent flows
- All-or-nothing vs best-effort gather semantics must be explicitly designed