Design an inventory management system
medium 80 minCount goods in several places, promise them to orders without ever promising too much, ship or let go, and explain every count.
Watch lesson4:28
Grow the design
Start with the smallest system that works. Change it only when something breaks.
Grow it
Five steps, each forced by a sentence
- 1
A map of numbers
Forced by: how many do we have?
- 2
Two counts in a line
Forced by: people pay later.
- 3
A reservation with picks
Forced by: give back exactly what was held.
- 4
A lock and two phases
Forced by: several products, several threads.
- 5
Policy, ledger, listener
Forced by: several places, why, and running low.
The design to reach: one coordinator, one guarded line, plain records
1/7Start from the verbs
Goods arrive, are promised, leave, or the promise ends. Four verbs on one coordinator, Inventory. Callers see nothing else.
implementsusesowns (dies together)