Subscribe free
Alloconomy 21 Nov 2026 3 min read

One order lookup and a year of shipments

Support needs the latest status for one order at p95 below 150 ms.

The interview prompt

Support needs the latest status for one order at p95 below 150 ms. Finance scans a year of shipments twice a day. Both use the same model and their peak loads overlap. Give a first design and one measurement that would make you change it.

Price the two reads independently

For support, ask whether “latest” means the most recently effective transition or the most recently received correction. With ordered source versions, an index on order identity and descending version can make the latest-state lookup cheap. A keyed current-state projection can be cheaper still if each order gets many reads. Measure end-to-end latency, including connection acquisition and any replica delay.

For finance, consider 100 million illustrative dispatch rows with 200 bytes of relevant and irrelevant fields combined. A full uncompressed row scan touches about 20 GB. Reading three columns totaling 24 bytes per row would represent 2.4 GB of logical values before metadata, compression, and filtering. This arithmetic explains the appeal of columnar storage. It does not predict wall-clock speed. Inspect the execution plan, observed bytes, spilled data, and contention.

I would first benchmark the indexed lookup during the finance scan. If both promises hold at expected peak, a second store adds operational cost without buying a needed outcome. If support latency fails only during scans, try workload isolation or a small rebuildable projection. State how to fail over and how stale that projection may become.

The model behind the answer

A support agent opens one order and needs its latest status. A buyer scans a year of dispatches by title. Estimate the rows each query touches, the columns it needs, its frequency, and its latency target. For the first, an indexed order lookup or keyed status projection is a sensible candidate. For the second, a columnar table can read the date, product, and quantity columns while skipping addresses and notes.

Putting both uses on one platform might be perfectly adequate. Inspect the plan and measure latency under representative concurrency before building a second store. If you materialize a weekly summary, its grain becomes part of the interface. A title-week summary cannot recover which school ordered a book.

Give the support projection a freshness target and a way to rebuild from retained dispatches. Give the analytical table a consistent read boundary for a multi-query report. These properties matter as much as a fast isolated query. PostgreSQL on reading a query plan · Apache Parquet

Review the evidence behind a performance claim

An agent recommends a new store after timing one lookup on an idle system. Give it a repeatable workload with both the support requests and the finance scan at their overlapping peak. Ask it to record the data version, concurrency and cache conditions.

Reviewer decision. Compare p95 lookup latency to the 150 ms target while the scan is running. Check finance totals against the baseline and measure projection lag as well. A faster stale answer may still fail support. The reviewer can keep the simpler design if it meets both consumers’ targets under the same load.

Further reading. Designing Data-Intensive Applications, 2nd ed., on the read pattern that makes column-oriented storage attractive.

One more question

A single-user benchmark meets 150 ms but the p95 during school registration is two seconds. What do you inspect?

Check your reasoning

Separate queue time from execution, inspect the slow percentile under realistic concurrency, and examine plan changes, hot keys, spill, and connection saturation. Optimize the measured bottleneck and compare again under the same workload.

Previous · Decide when yesterday can change · Next · Choose a layout from a real filter · Complete series map