System Design Atlas

Parcel delivery with offline synchronisation

02 / 10Worked example

Requirements

Why is 43 not applied immediately?

An accepted upload does not yet prove correct ordering.

Starting point Check lastAppliedSequence 41 and the missing 42.

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.

Requirements

Function, invariant and measurement target remain visible.

Requirements (functional)

Further reading
Upload offline events
Events arriving as 41, 43, 42 are durably accepted and applied in order through 43.
Content protection
An altered duplicate remains conflict and does not overwrite a state.

Quality goals (non-functional)

Further reading
Peak throughput
Process 500 events/s with gap and duplicate mix.
Traceability
Keep gap age, conflicts and projection status measurable.

Terms in this step

Fingerprint
Comparable imprint of the content under a stable key.

Try it yourself

Determine the result and state of affairs after receiving 43.

A hint for your attempt

Acceptance and application are separate.

Compare with a possible solution
Acceptance
43 is permanently buffered.
Domain state
The domain state remains at 41.

Apply to your project

Use the mobile inventory capture pattern.

The numbers determine storage and load profiles.