System Design Atlas

Parcel delivery with offline synchronisation

07 / 10Worked example

Critical flow

When is delivered visible?

The participant sequences show acceptance and domain effect separately.

Starting point Follow lastAppliedSequence.

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.

Participant sequences

Three tabs lead through the critical synchronization variants.

Results

41, 43, 42
43 waits and is applied after 42.
modified 43
Conflict without overwriting.
R-17/v3
superseded without domain effect.

Terms in this step

Gap buffer
Buffers accepted later events until their predecessors arrive.

Try it yourself

Determine the status after 41, 43 and 42.

A hint for your attempt

43 contains N-17.

Compare with a possible solution
After 43
Applied through 41; 43 is buffered.
After 42
Applied through 43; delivered with N-17.

Apply to your project

Play through a gap over three events.

Diagnosis makes backlogs explainable.