External Sort: Same Top-K, Bounded RAM

External Sort: Same Top-K, Bounded RAM A data-flow diagram generated by Archify. 01 / Source 02 / Extract 03 / Chunk 04 / Runs 05 / Report access.log · immutable input · 01 / Source · teaching log access.log immutable input teaching log Extract URL · field 7 per line · 02 / Extract Extract URL field 7 per line Chunk Sort · sort a bounded chunk · 03 / Chunk · fits in RAM Chunk Sort sort a bounded chunk fits in RAM Sorted Run Files · spill, then merge · 04 / Runs Sorted Run Files spill, then merge Merge + Count · k-way merge, count runs · 05 / Report Merge + Count k-way merge, count runs Top-K Rank · rank, head -n K · 05 / Report Top-K Rank rank, head -n K read log lines immutable log lines URL stream one URL per line sorted runs spill bounded chunk leaves RAM merge segments segments merged in order counted pairs counted pairs Legend primary data async batch data store