November 23 · Scale the measured bottleneck
When is one well-designed database no longer enough—and what complexity would distribution buy us?
Today’s sequence follows Alex Reinhart’s Distributed Data and Computation. Hadoop/MapReduce ideas are treated as enduring design concepts; the project decision begins with measured Fall 2026 workloads.
Current reference: Apache Spark cluster overview.
You should be able to:
Ask:
Distribution is an architecture change, not a performance adjective.
Scale up: more CPU, RAM, or faster storage on one system.
Scale out: partition data/work across multiple systems.
Scale-out adds coordination, retries, skew, and partial failure.
Large immutable source files can live in object storage partitioned by source/date while PostgreSQL holds curated facts and indexes.
This hybrid is often enough.
Possible keys:
A good key prunes most data for common work and avoids one giant hot partition.
Choose the slowest inherited workflow. Record data size, elapsed time, rows read/written, and one plan or system clue. Name the simplest plausible fix.
Classic MapReduce:
The shuffle is often the expensive part.
Map: parse event rows and emit (state, 1).
Shuffle: group all values for the same state.
Reduce: sum counts for each state.
If every worker needs every row, the partition plan failed.
Small lookup + huge fact table:
Two huge tables keyed alike:
Spatial or many-to-many join:
One state, year, route, or key may dominate the data.
Average partition size can look fine while one worker determines the finish time.
Inspect the distribution, not only total bytes.
Rewrite one client aggregation as map/shuffle/reduce. State the partition key, shuffled key, partial result, and likely skew.
Then ask whether PostgreSQL already performs it adequately.
Distributed workflows need:
The idempotency lesson returns at a larger scale.
If partitions finish at different times, when is the dataset ready?
Use a manifest, atomic pointer, or publish step so clients do not mix old and new partitions unknowingly.
Modern engines can keep data in memory, build a directed execution plan, and optimize many transformations beyond classic disk-heavy MapReduce.
They still pay for shuffles, skew, serialization, and coordination.
Recommend one of three actions: keep one database, add object-storage partitions, or distribute compute. Support it with the measured bottleneck and an acceptance threshold.
Include the new failure mode your choice introduces.
Add a scaling boundary to the inherited architecture: current limit, measurement, next intervention, and trigger for reconsidering distribution.
Do not add infrastructure the receiver cannot operate.
Homework 3 may use a scale design as its extension only when it includes a measured bottleneck and a small executable analogue or benchmark.
After Thanksgiving: package the workflow so the receiver installs a command, not a pile of files.
Adapted from Alex Reinhart · MADS Computing