Layer 3 · Go deeper · 9 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
Why do event pages push order pages out of memory?
How fast do one-event-per-commit inserts age every table?
How long until checkout is back after losing the primary?
Build-up · 6 steps
Split the database by access pattern
One primary holding everything, emptied one workload at a time, biggest and least valuable first, until checkout’s database holds what must commit together.
Step 1 of 6
Everything in one primary
Orders share CPU, cache, WAL, connections and a 2 TB backup with telemetry, audit rows, PDFs, sessions and a polled jobs table.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“Client taps, scrolls and rider GPS pings are 75% of the primary’s row writes. Where should they go?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“Invoice PDFs live in a bytea column, about 15 KB each, and write a tenth of the WAL. What do you change?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“A regulator needs each audit row in the same transaction as its order. Audit is 250 GB and growing. What do you do?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“A new product does 2 orders a second on 20 GB. A teammate wants Kafka, Redis, S3 and a warehouse from day one. Your call?”
Your move. Pick an approach: