Layer 3 · Go deeper · 6 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Build-up · 5 steps
Follow one order through the outbox
A food order from tap to kitchen. Steps 1 and 2 are the request; everything after the commit happens in the background.
Step 1 of 5
One local transaction
The order service inserts the orders row and an OrderPlaced row into the outbox table in one transaction. Both commit, or neither does.
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
“Your order service needs a relay. Volume is moderate and there’s no CDC platform yet. What do you build?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“Payments consumes OrderPlaced and captures money. The relay is at least once. How do you make sure nobody is charged twice?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Outbox volume is outgrowing one relay. How do you scale it without reordering a payment’s PENDING and SUCCESS?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“At 6,000 events a second, the outbox grows by hundreds of millions of rows a day. How do you clean it up?”
Your move. Pick an approach:
Build-up · 4 steps
How two relays reorder one payment
Payment pay-42 goes PENDING, then SUCCESS. Two relay replicas poll the outbox at the same moment.
Step 1 of 4
One payment, two events
The outbox holds pay-42’s events as rows 41 and 42, in commit order, because both transactions updated the same payment row.