SD-21 · SORTING LARGE DATA SETS · INTERACTIVEBreak it.
Break it.
Then fix it.
Grow the data set, watch the job crash or crawl, and add the parts a real distributed sort needs. Every switch is a decision you would defend in an interview.
CHALLENGESort 100 TB in under 30 minutes, with even ranges and no full restarts when a worker dies.
StatusSTRAINEDAt 10 TB
Job time212 minTarget under 30 minutes
Expected failures0.6Each restarts the job
Workers25400 GB each
Cost per run$176At $2 a worker-hour
Input filesINPUT
10 TB of 100-byte recordsobject storage
CoordinatorRESTARTS
Plan in memory only25 workers
Map workers × 25DOWN
Runs to disk, then merge400 GB each
Local disksDOWN
Raw runs4 s/GB of passes
Merge workers × 25DOWN
Equal-width rangesbusiest gets 4× its share
Sorted outputOUTPUT
Part files + manifestin key order
One worker got 4× its share. Equal-width key ranges ignore how lumpy real keys are, and the job waits for the busiest worker. Sample 0.01% of keys and cut ranges from the sample.
200 GBSort memory per machineAnything bigger needs sorted runs on disk and a merge: 2 passes.
4×Skew without samplingEqual-width ranges give the busiest worker 4× its share; sampled ones about 1.1×.
2×From compressionDisk passes are 80% of the time, so fewer bytes is the best lever.
0.9Failures per 100 TB run250 workers for 23 minutes: retry tasks, not jobs.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.