System Design Atlas

Dispatch centre with changing incident information

07 / 10Worked example

Critical flow

Exactly one assignment wins a unit. Which conditions enforce this rule?

Two incidents compete for the same available unit.

Starting point The API manages assignments; the projection provides the overview.

Assumptions for the example case

A fictional command exercise with no connection to real response units. Dispatch makes the decisions, supported by suggestions and maps. Availability and an accepted assignment remain separate facts. All quantities, thresholds and operational targets in this design are illustrative assumptions.

Two incidents, one unit

Two incidents, one unit

Both dispatchers expect the same available-unit revision.

Dispatcher A
Dispatch API
Incident datastore
Training radio gateway
Dispatcher B
Transmission worker
  1. 01 Dispatcher A → Dispatch APIIncident A / U-45 / revision4
  2. 02 Dispatch API → Incident datastoreAtomically allocate U-45
  3. 03 Dispatch API · Local processingWinning response lost
  4. 04 Dispatcher B → Dispatch APIAnother incident requesting the same expected available U-45
  5. 05 Dispatch API → Dispatcher BConflict: unit already allocated to Z-45
  6. 06 Dispatcher A → Dispatch APIIdentical replay
  7. 07 Dispatch API → Dispatcher AStored assignment Z-45
  8. 08 Transmission worker → Incident datastoreRead the committed transmission job
  9. 09 Transmission worker → Training radio gatewayTransmit Z-45 with assignment revision 4
  10. 10 Training radio gateway → Dispatch APIMatching acknowledgement revision4

Result: One winner; replay returns Z-45 and the competing allocation receives a conflict.

Winning commit, transmission and acknowledgement remain bound to the assignment revision.

Dispatchers → API → atomic allocation; winning commit; response loss; replay and acknowledgement.

Commit, response loss and resumption

U-45 available at revision 4
Attempt assignment for incidents A/B and B/A → one winner; the other receives an assignment conflict.
Z-45 angenommen
Identical command, then a different destination under the same key → same assignment; changed content produces a conflict.
Acknowledgement pending since 0
9,999/10,000/10,001 ms → follow up from 10,000 ms; the unit remains allocated.

Exactly one assignment wins a unit.

Exactly one assignment wins a unit.

An atomic version check protects the assignment.

Two incidents compete for the same available unit.

In either order, the first commit wins and the other conflicts. Replay reads Z-45; no second allocation or new transmission intent is created.

Alternative considered
Resolving conflicts after assignment would allow two commitments.
Trade-off
The losing request must find another unit.
Reassess
Multiple resources require an extended contract.

Try it yourself

Predict both winner orders and the result of response loss.

A hint for your attempt

Two incidents compete for the same available unit.

Compare with a possible solution
Winner orders
In either order, the first commit wins and the other conflicts.
Response loss
Replay reads Z-45; no second allocation or new transmission intent is created.

Apply to your project

What is the equivalent of one winning assignment per unit in your project?

Step 8: stale positions and missing acknowledgements are different issues. Which measurements distinguish them?