Performance Engineering / Orchestr8, production supply-network visualization
Recalculating a year of stock history for any date, in about half a second
per map view, even on horizons that reach 100M+ rows
~0.5 s
Today and checkpoint dates read precalculated results in about half a second; other dates recalculate at most 7 days live, in a few seconds. It holds across the whole forward horizon, which on the largest datasets reaches 100M+ rows.
Inventory turns can't be read from a table. The correct formula replays a year of stock levels, orders and stock movements, part by part, for any date on the map.
My role I designed and built the precalculation that runs when new data arrives, how its results go live, and the checkpoints for future dates.
Context Supply Network Map & Simulation, Orchestr8
Key decision
Precalculate the heavy history whenever new data arrives, checkpoint the future every two weeks, and leave only a few days to each click.
Problem
Why it has to be precalculated
- One value on the map is a full replay: a year of stock levels, orders and stock movements.
- Each order counts for the warehouse the part sat in that day, in one currency.
- Across every part, that cannot run while someone waits.
Insight
The trade-off, chosen on purpose
Numbers refresh when new data arrives, not on every click, and dates between checkpoints take a few seconds. In return, nothing heavy runs while someone waits, and storage stays small.
Mechanism
Future dates, precalculated every two weeks
- Stock level, past year
- Throughput
- Average inventory
- Checkpoint
Inventory turns = throughput ÷ average inventory
Schematic: not to scale.
- When new data arrives, the past year is replayed once: throughput over average inventory gives the turns, and they are stored.
- Future dates get a checkpoint every two weeks.
- A click starts from the closest checkpoint and recalculates at most 7 days.
Today and checkpoint dates are read directly, in about half a second. Any other date takes a few seconds.
What a single click still gets right
Custom advanced filters
Efficient on every click; the heavy part is already stored.
History by the right warehouse
Orders count where the part was that day.
Any supported future date
Never more than 7 days from the closest checkpoint.
One currency
Converted before warehouses are compared.
Never half-published
New data goes live whole, or not at all.
Outcome
Fast at any date, with any filter
The heavy part is precalculated once, when new data arrives. Today and checkpoint dates answer in about half a second, other dates in a few seconds, with any filter.