All projects

Storage shaped
by the question

A table's physical layout should be dictated by how it is read, not by how it happens to be written. Once storage mirrors the shape of the questions the business actually asks, both the database and the people maintaining it get their work cut down for free.

System
Passenger profiling platform
Scale
535M rows across 16 airports
Role
Sole architect and engineer
Stack
PostgreSQL / Partitioning / SQL
01

The challenge

Analytical questions over half a billion rows were reading far more data than the customer was entitled to see, and pushing past the request timeout.

02

The approach

Split the table along the two axes that matter — who is asking, and how writes arrive — then rewrite the read path to match.

03

The result

Customer dashboards answer in seconds instead of timing out, upkeep became a bounded operation, and tenancy is enforced by the layout itself.

The table is split by airport and sub-split by passenger, so a customer query is physically confined to a single column of the grid. 01 Dashboard query FCO DXB SIN LHR +12 more bucket 0 bucket 1 bucket 2 Everything outside the lit column is never touched
The table is split by airport and sub-split by passenger, so a customer query is physically confined to a single column of the grid. 01 Dashboard query FCO DXB SIN … b0 b1 b2 The rest is never touched
Fig. 02 — Every customer question is answered inside one lit column

Hover any step to read what it doesTap any step to read what it does