System Design Atlas

Parcel delivery with offline synchronisation

10 / 10Worked example

Final design

Which two tests close the largest evidence gap?

The decision card refers to rules and open infrastructure tests.

Starting point Distinguish the domain model from the actual infrastructure.

Assumptions for the example case

Illustrative design: 100,000 shipments per day, 50 events per shipment, 250 bytes of raw data per event, 500 events/s peak. This yields 5 million events and 1.25 GB of raw data per day. Retention, indices and replication are added.

Decision map

Architecture, test case and return remain connected.

Current decisions

Acceptance

append-only key and fingerprint

Duplicates and conflicts remain distinguishable

Trade-off
Additional event inventory
Reassess
In the case of guaranteed one-time delivery
Domain state

Apply a contiguous projection per route

Offline order remains deterministic

Trade-off
Later events can wait
Reassess
When device behavior changes

Outstanding evidence

Persistence
Crash between inbox and projection commit.
Load
500 events/s with gaps, duplicates and projections.

Terms in this step

Recovery
Stored work can resume after a crash without duplicate effects.

Try it yourself

Plan crash and load test.

A hint for your attempt

Define intermediate state and success criterion.

Compare with a possible solution
Crash
Inbox remains; projection continues once.
Load
500/s without lost keys and with a measurable gap age.

Apply to your project

Fill in the template for your own offline case.

The design can now be validated with real devices.

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

    Transfer the border to maintenance technicians in the field.

    In the example: The case begins at R-17/v4 and ends with an evidenced delivery status.

  2. Requirements

    Use the mobile inventory capture pattern.

    In the example: Ordering, content protection and throughput require separate tests.

  3. Scale estimates

    Calculate seven days of raw data without overheads.

    In the example: Simulate 500/s with gaps, duplicates and multiple devices.

  4. Interfaces

    Define results for an offline form upload.

    In the example: 2xx acceptance may mean a buffered state that has not yet been applied.

  5. Data and states

    Form a key for a second device.

    In the example: Event acceptance and the shipment projection are separate but traceably linked.

  6. Overall architecture

    Use the separation for sensor data.

    In the example: Append-only ingestion and a relational projection protect retry behaviour and readability.

  7. Critical flow

    Play through a gap over three events.

    In the example: The device sequence orders events within exactly one route version.

  8. Bottlenecks and trade-offs

    Define an alarm for 30 minutes gap age.

    In the example: A backlog becomes actionable only with its route, device and sequence context.

  9. Operations and security

    Define a controlled correction process.

    In the example: Technical operations can reprocess events; actual delivery requires an evidenced courier or recipient action.

  10. Final design

    Fill in the template for your own offline case.

    In the example: The explanatory model fixes the domain rules; actual device, persistence and load guarantees remain to be tested.