System Design Atlas

Rail timetables and disruption information

08 / 10Worked example

Bottlenecks and trade-offs

Which measurements distinguish business waiting times and technical bottlenecks for rail passengers?

The sequence is defined; now test its possible bottlenecks. A fast API can deliver stale passenger information. Measure source age, processing lag and display version separately. The following measures are initial decisions to test; their benefits have yet to be measured.

Starting point Store the cancellation before publishing it.

Assumptions for the example case

Original fictional design: a regional rail line with dated services, stops and manually confirmed cancellations. An actual-status report is current at age < 90 seconds; at 90 seconds its timestamp is marked stale. All figures and test targets are illustrative assumptions.

Trace symptoms to their causes

Branched diagnostic tree

Stale displaySignal
Measure source ageMeasurement
Reconcile feed gapsAction
Cancellation disappearsSignal
Compare the display versionMeasurement
Rebuild projection from the status storeAction
Unknown train serviceSignal
Check the matching rateMeasurement
Dispatch resolves identityAction

For each cause, connect the signal, distinguishing measurement and targeted action.

A fast API can provide outdated passenger information: source age, processing delay and display version are measured separately.

Measure before making changes

SymptomValidationTargeted action
A fast API can provide outdated passenger information: source age, processing delay and display version are measured separatelyCheck source freshness, the business reason for waiting and processing time separately.Address the evidenced cause first, then retest the same case.
100 reports for the same train service in reverse source orderMeasure the duration of the atomic decision and concurrent access.Move lengthy work outside the commit; preserve the business invariant in the concurrency test.
Stale display despite stored evidenceCompare the authoritative version with the projection version.Rebuild the projection; continue deciding state changes from the authoritative state.

A fast API can provide outdated passenger information: source age, processing delay and display version are measured separately

Validation
Check source freshness, the business reason for waiting and processing time separately.
Targeted action
Address the evidenced cause first, then retest the same case.

100 reports for the same train service in reverse source order

Validation
Measure the duration of the atomic decision and concurrent access.
Targeted action
Move lengthy work outside the commit; preserve the business invariant in the concurrency test.

Stale display despite stored evidence

Validation
Compare the authoritative version with the projection version.
Targeted action
Rebuild the projection; continue deciding state changes from the authoritative state.

Reject outdated reports during projection

Reject outdated reports during projection

Reject outdated reports during projection.

A fast API can provide outdated passenger information: source age, processing delay and display version are measured separately.

A fast API can deliver stale passenger information. Measure source age, processing lag and display version separately. The exercise specifies the input and expected result.

Alternative considered
Adding compute capacity indiscriminately does not resolve missing business evidence.
Trade-off
Multiple measurement points and separate causes increase the diagnostic effort.
Reassess
Use measurements after the targeted change to decide whether further scaling is needed.

Try it yourself

Name two different causes of delay in this case. Choose a measurement for each and justify the first action.

A hint for your attempt

Record the business reason for waiting, source age and technical compute time separately.

Compare with a possible solution
Case-related diagnosis
A fast API can deliver stale passenger information. Measure source age, processing lag and display version separately. First distinguish these causes using their own timestamps and states.
Hotspot
Measure concurrent access and commit duration for 100 reports about the same service in reverse source order. Move lengthy external work outside the transaction, then repeat the same concurrency test.

Apply to your project

Which similar display could have two different causes in your project?

Next: assign feed gaps to the responsible dispatcher.