Three teams, one order change
An orders platform is being split up. Three teams — fulfilment, fraud review, and the customer-facing timeline — all need to know when an order changes. They have been reading each other's tables. That stops now.
Five sentences describe what the new path has to do. The components already drawn are settled; the empty bays are not.
- R1Every one of the three teams must receive every order change, independently. One team consuming a change must not consume it away from anyone else.
- R2Changes to the same customer's orders must be applied in the order they happened. Changes to different customers have no relationship and must not queue behind each other.
- R3It must be impossible for an order change to be committed without its notification, or for a notification to exist for a change that rolled back.
- R4Fraud review is slow and occasionally fails outright. Its backlog must be its own, so that a change it cannot process does not hold up the teams beside it.
- R5The timeline team serves reads at a rate the orders store cannot support, and does not need to see a change the instant it happens. What it reads must survive a restart.
Boundaries, outermost first: CONSUMERS: Timeline (read-heavy), Fulfilment, Reviewer (works the parked pile), Fraud review (slow, sometimes fails), an empty slot for the serves reads the write store cannot, tier 3 WRITE SIDE: Orders store (system of record), Orders API, an empty slot for the written in the same commit as the order, tier 1, an empty slot for the drains committed rows, publishes after, tier 1 DISTRIBUTION: Parked changes (after repeated failures), an empty slot for the all three teams get every change, tier 2, an empty slot for the one slow consumer, its own backlog, tier 2 Connections: Orders API calls Orders store Orders API calls written in the same commit as the order Orders store controls written in the same commit as the order — same transaction written in the same commit as the order calls drains committed rows, publishes after drains committed rows, publishes after publishes to all three teams get every change all three teams get every change publishes to Fulfilment all three teams get every change publishes to one slow consumer, its own backlog all three teams get every change publishes to serves reads the write store cannot one slow consumer, its own backlog publishes to Fraud review one slow consumer, its own backlog publishes to Parked changes Parked changes calls Reviewer serves reads the write store cannot calls Timeline