System Design Atlas

International humanitarian aid logistics

04 / 10Worked example

Interfaces

Event identifiers remain stable across offline retries. Which conditions ensure this outcome?

The device may lose the acknowledgement.

Starting point Calculate storage capacity and goods quantities separately.

Assumptions for the example case

A fictional shipment of 100 boxes of hygiene supplies between a warehouse and a distribution point. Local inventory ownership remains clear; offline devices document assigned shipments. All quantities, thresholds and operational targets in this design are illustrative assumptions.

Offline evidence

Persist offline evidence before changing quantities

Transportation deviceU-49 · 98/2
Transportgerät → Lokaler Pufferoffline storage
Local bufferUnchanged identifier
Lokaler Puffer → SynchronisationsadapterSend authenticated
Synchronization adapterChecking Replay
Synchronisationsadapter → NachweisspeicherSave U-49 first
Evidence storeImmutable 98/2 document
Synchronisationsadapter → SendungsbestandAfter durable storage confirmation: reference + quantity atomically
Shipment recordsHistorical receipt

U-49 is first stored immutably; the evidence reference and quantity effect then commit together before acknowledgement.

Device → local buffer → synchronisation → commit → acknowledgement; the identifier remains unchanged on replay.

Proposed domain contracts

  1. POST/sendungen/S-49/versand

    Deduct assigned goods from inventory.

    Input
    commandKey, batch=C-49, quantity=100, warehouseVersion, carrierReceiptHash
    Result
    Shipped with 100 boxes or stock conflict.
    Retry behaviour
    Identical dispatch is applied once; a changed quantity causes a conflict.
  2. POST/sendungen/S-49/empfang

    Durably accept an offline receipt record.

    Input
    deviceId, eventId=U-49, shipmentRevision, accepted=98, damaged=2, receivedAt, proofHash
    Result
    Receipt accepted; discrepancy resolution remains open.
    Retry behaviour
    The same event identifier and content apply once; changed quantities require a separate correction operation.

Event identifiers remain stable across offline retries.

Event identifiers remain stable across offline retries.

Replay uses the same identifier and payload.

The device may lose the acknowledgement.

One stored receipt record, the same response. Conflict; a correction requires its own reference and domain review.

Alternative considered
A new identifier for each attempt creates duplicate quantities.
Trade-off
The device must persist the identifier.
Reassess
Device replacement needs a recovery contract.

Try it yourself

Check Replay 98/2 and Change 99/1.

A hint for your attempt

The device may lose the acknowledgement.

Compare with a possible solution
Identical
One stored receipt record, the same response.
Changed
Conflict; a correction requires its own reference and domain review.

Apply to your project

How does “Event identifiers remain stable across offline retries” apply to your own project?

Step 5: In transit is not a completed outcome. Which conditions ensure this outcome?