Aman Goyal

LeetCode LeetCode

Scatter/Gather: Reducing Latency with Parallel Distributed Processing

Core Concept


What It Solves


How It Works

[ Client ]
     ↓
[ Root / Coordinator ]
     ↓↓↓
[ Leaf 1 ] [ Leaf 2 ] [ Leaf 3 ]
     ↓↓↓
[ Partial results ]
     ↓
[ Root combines → Final result ]

When to Use

Also called “embarrassingly parallel” problems


Two Variants

1. Pure Scatter/Gather (replicated data)


2. Sharded Scatter/Gather

Used for:


Key Challenges

1. Diminishing returns (overhead)

Beyond a point → performance stops improving


2. Straggler problem (VERY IMPORTANT)

More nodes → higher chance of slowdown


3. Reliability issues


Solutions

1. Replicate each shard


2. Smart scaling


Key Insights


Trade-offs

Pros

Cons


One-line Summary

Scatter/Gather distributes a request across multiple nodes for parallel processing and combines results to reduce latency, but performance is limited by overhead and the slowest node.

#Distributed Systems #System Design #Scatter Gather #Parallelism #Latency