System Design Atlas

Warehouse fulfilment and dynamic route planning

10 / 10Worked example

Final design

Which tests prove contention protection and completion for picking orders in the overall architecture?

The final design reuses the full topology from step 6. Inside the system boundary: interface → warehouse API → inventory by location, allocations, picks and handovers. Route and shipping processing reads durable work from this store. The shipping system is external. Domain messages follow the main flow; results reach the interface through the warehouse API. The test plan adds concurrency, retries, exact boundaries and terminal completion for picking order E-36. The table gives expected outcomes; test execution evidence remains outstanding.

Starting point Inventory corrections require a separate permission.

Assumptions for the example case

Own fictitious example design. A warehouse with integer quantities, manual picking and a heuristic route recommendation. A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence. All figures and test goals are illustrative assumptions.

Overall architecture with checks and review loops

Runtime topology

  1. 1 · Order planning → Warehouse API
  2. 2 · Warehouse API → stock by location and allocations
  3. 3 · Stock by location and allocations → route planner
  4. 4 · Scanner path → warehouse API
Order planningRequirements and quantities
Shipping systemAcknowledge the staged shipment

Warehouse fulfilment

Warehouse APIatomic commitments
Stock by location and allocationsAuthoritative relational data store
Route plannerRecommendation from Snapshot only
Scanner pathwayEvidence of actual removal
Dispatch operationsSend staged orders
Order planning → Warehouse APIRequirements
Warehouse API → Stock by location and allocationsatomic allocation
Stock by location and allocations → Route plannerSnapshot without Commitment
Scanner pathway → Warehouse APIPick record
Warehouse API → Dispatch operationsStaged order
Dispatch operations → Shipping systemHandover and receipt
Replay 4 · State 5 · Flow 7 · Operations 9Check the route plan from 60 s

Open allocations do not exceed available stock at the location; routes do not change commitments.

Order planning writes need to warehouse API. Relational stock at the storage location and allocations form the atomic promise limit. An own route-planning process reads a snapshot and provides only recommendations to the picking. Scanner confirmations are sent directly to the warehouse API and generate pick records; the route-planning process must neither replace nor correct them. Transit processing shall transmit the orders provided to the external shipping system and receive receipts. The diagram contrast between dashed suggestion path and binding set path is essential. The same building blocks and arrows as in step 6. Test marker: API/Commit → Contention and Replay (4/5/7); Boundary Check → Exact Boundary (2); Specialist Role/Close → Terminal Evidence (9).

Test plan for the complete design

ComponentTest and expected resultReturn to an earlier step
Warehouse APIWith location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together.Steps 3 and 5
Command journalIdentical retries take effect once; changed content produces a conflict.Steps 4 and 7
Domain boundary checkCheck values 59, 60 and 61 seconds. Oracle: A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence.Step 2
Inventory by storage location, allocations, picks and handoversAn identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.Steps 5 and 9
Route and shipping processingA picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick.Steps 6 and 7

Warehouse API

Test and expected result
With location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together.
Return to an earlier step
Steps 3 and 5

Command journal

Test and expected result
Identical retries take effect once; changed content produces a conflict.
Return to an earlier step
Steps 4 and 7

Domain boundary check

Test and expected result
Check values 59, 60 and 61 seconds. Oracle: A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence.
Return to an earlier step
Step 2

Inventory by storage location, allocations, picks and handovers

Test and expected result
An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.
Return to an earlier step
Steps 5 and 9

Route and shipping processing

Test and expected result
A picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick.
Return to an earlier step
Steps 6 and 7

First end-to-end test and outstanding evidence

End-to-end path
The last piece and double pick form the end-to-end path. A picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick.
Clarify before extending the scope
Agree on the actual shipping-system contract, retention, recovery targets and roles. All limits here are design assumptions. The evidence table specifies tests to run; technical integration, browser checks and reader comprehension checks follow separately.

Test the last item and a duplicate pick end to end

Test the last item and a duplicate pick end to end

Test the last item and a duplicate pick end to end.

Two picking orders compete for the last item in the same storage location. A shorter route plan shall not alter the quantity already allocated. Completion requires technical and domain evidence.

For stock at the storage location 1 piece and open allocation 0, two allocations compete for the last piece. In both winning orders, exactly one wins: space remains 1, open allocation becomes 1, newly available is 0. The unsuccessful contract shall not be sub-alloted. Only the confirmed pick sets the space available and open allocation together to 0. The exercise specifies the input and expected result.

Alternative considered
An initial end-to-end path limited to lists and forms postpones the critical state checks.
Trade-off
The first end-to-end path needs controlled concurrency and failure points.
Reassess
Passing the counterexample tests and checks with readers provides grounds for extending the case.

Try it yourself

Choose two architectural decisions: concurrency protection and evidence-backed completion. For each, name the test, expected result and step to revisit.

A hint for your attempt

Link the markers of the overall architecture with the associated design steps.

Compare with a possible solution
Concurrency control
For stock at the storage location 1 piece and open allocation 0, two allocations compete for the last piece. In both winning orders, exactly one wins: space remains 1, open allocation becomes 1, newly available is 0. The unsuccessful contract shall not be sub-alloted. Only the confirmed pick sets the space available and open allocation together to 0. The invariant is expected: Open allocations do not exceed the confirmed available stock at the location; route recommendations do not change the quantity commitment. Deviation leads back to step 5 and to the command contract in step 4.
Test completion and retries
Starting point: location stock 1 item, open allocation 1 item for one order, newly available stock 0 items. Confirm the full pick and retry the identical scan record. Expected result: stock 0, open allocation 0, exactly one pick record. After staging and shipping acknowledgement, the order is complete; a new pick command conflicts. Test cancellation separately before picking: investigate a shortage and cancel twice identically. Release the allocation once; cancellation does not increase physical stock. Failures lead back to step 9 for ownership and step 7 for the failure sequence.

Apply to your project

Which two counterexample tests will you run first in your own end-to-end implementation?

Transfer the architecture and counterexamples to the editable Markdown design template.

Start your own design

Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.

Download design template (.md)
Compare the ten tasks with the example case
  1. Purpose and boundary

    What proof of picking order would arise in your own project outside of the application?

    In the example: Inventory management and route recommendations have separate responsibilities. One warehouse with whole-item quantities, manual picking and a heuristic route recommendation.

  2. Requirements

    Which rule of your project remains binding even with slow processing?

    In the example: Picking requires an allocation and physical evidence. A route plan is marked for rechecking from age 60 seconds; confirmed picks remain valid records.

  3. Scale estimates

    Which single item concentrates the load more than the daily mean value for warehouse orders?

    In the example: The last item determines the conflict test. An average of 2 events/s says little about 50 allocations competing for one item at the same location.

  4. Interfaces

    Which input fields make two change intentions different in your project?

    In the example: A pick binds the storage location and actual quantity. The order, location, allocated quantity, actual item count and scan record must remain identical on replay.

  5. Data and states

    Which states must remain protected in your model against late replay?

    In the example: Stock and open allocations change together. An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.

  6. Overall architecture

    Which planned service boundary would distribute a currently local guarantee across the network?

    In the example: The route planner must not write authoritative quantities. Inventory by storage location, allocations, picks and handovers must express the same valid state.

  7. Critical flow

    What feedback could be missing even though the underlying action has already taken place?

    In the example: Repeating a scan returns the same pick record. Open allocations do not exceed confirmed available stock at the location; route recommendations do not change quantity commitments.

  8. Bottlenecks and trade-offs

    Which similar display could have two different causes in your project?

    In the example: Optimise route length and lock duration separately. Long walking distances and high lock wait times are different bottlenecks. Route length in metres is assessed against location order; lock duration is measured at the quantity-allocation commit.

  9. Operations and security

    Which open state in your project needs a domain specialist as well as technical operations?

    In the example: Inventory corrections require a separate permission. An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.

  10. Final design

    Which two counterexample tests will you run first in your own end-to-end implementation?

    In the example: Test the last item and a duplicate pick end to end. With location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together.