System Design Atlas

Rail timetables and disruption information

10 / 10Worked example

Final design

Which tests verify concurrency protection and completion for the train service in the overall architecture?

The final design reuses the complete topology from step 6. Inside the boundary: interface → train service status API → train service status, source reports and cancellation history. Feed processing reads durable work from this store. The timetable service is external. Processing receives or sends the business messages in the main flow; results reach the interface through the train service status API. The plan tests concurrency, retries, limits and terminal completion for train service F-24. The table lists expected results; execution evidence is still outstanding.

Starting point Assign feed gaps to the responsible dispatcher.

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.

Overall architecture with checks and review loops

Runtime topology · processes, data stores and external systems

  1. 1 · Timetable service → Feed processing
  2. 2 · Feed processing → Relational status store
  3. 3 · Relational status store → Rebuildable display projection
Timetable serviceScheduled services and source reports

Train service status system

Train service status APIAuthorise cancellation and correction
Relational status storeVersion and cancellation decision
Feed processingDurably accept source reports
Rebuildable display projectionBuilt from the status store
Timetable service → Feed processingScheduled service or actual-status report
Feed processing → Relational status storeMatched source version
Train service status API → Relational status storeAuthorised cancellation or correction
Relational status store → Rebuildable display projectionHighest valid status version
Concurrency and replay4 · 5 · 7
Exact limitSource age < 90 s: current · At 90 s: stale · 2
CompletionRole evidence · 9

Timetable, source report, authoritative status and passenger display remain separate; there is no train-control path.

The timetable service supplies scheduled services; dispatch confirms cancellations and corrections. Feed processing durably accepts and matches reports. A relational status store holds versions and cancellation decisions; a rebuildable display serves passengers and the passenger information team. Flows: timetable service → feed processing → status store; dispatch → train service status API → status store; status store → display projection → passenger interface. There is no train-control path. Components and arrows match step 6. Test markers: API/commit → concurrency and replay (4/5/7); limit validation → exact boundary (2); domain role/completion → terminal evidence (9).

Test plan for the complete design

ComponentTest and expected resultReturn to an earlier step
Train service status APITwo reports with source versions 8 and 9 arrive in both orders: version 9 remains visible; version 8 is retained in history and does not overwrite the display.Steps 3 and 5
Command journalIdentical retries take effect once; changed content produces a conflict.Steps 4 and 7
Domain boundary checkTest ages 89, 90 and 91 seconds. Expected result: an actual-status report is current at age < 90 seconds; at 90 seconds its timestamp is marked stale.Step 2
Train service status, source reports and cancellation historyAfter archiving, a new cancellation command produces a conflict; an identical old retry returns its original result.Steps 5 and 9
Feed processingPublication fails after the cancellation commit. Feed processing rereads the stored publication job and updates the display using the status version. An older report arriving late cannot reduce that version.Steps 6 and 7

Train service status API

Test and expected result
Two reports with source versions 8 and 9 arrive in both orders: version 9 remains visible; version 8 is retained in history and does not overwrite the display.
Return to an earlier step
Steps 3 and 5

Command journal

Test and expected result
Identical retries take effect once; changed content produces a conflict.
Return to an earlier step
Steps 4 and 7

Domain boundary check

Test and expected result
Test ages 89, 90 and 91 seconds. Expected result: an actual-status report is current at age < 90 seconds; at 90 seconds its timestamp is marked stale.
Return to an earlier step
Step 2

Train service status, source reports and cancellation history

Test and expected result
After archiving, a new cancellation command produces a conflict; an identical old retry returns its original result.
Return to an earlier step
Steps 5 and 9

Feed processing

Test and expected result
Publication fails after the cancellation commit. Feed processing rereads the stored publication job and updates the display using the status version. An older report arriving late cannot reduce that version.
Return to an earlier step
Steps 6 and 7

First end-to-end test and outstanding evidence

End-to-end path
Test a cancellation followed by a late delay report end to end. Publication fails after the cancellation commit. Feed processing rereads the stored publication job and updates the display using the status version. An older report arriving late cannot reduce that version.
Clarify before extending the scope
Agree the real timetable-service contract, retention periods, recovery targets and assigned roles. Every limit here is a design assumption. The evidence table describes tests to execute; technical integration, browser checks and comprehension checks with readers follow separately.

Test a cancellation followed by a late delay report end to end

Test a cancellation followed by a late delay report end to end

Test a cancellation followed by a late delay report end to end.

A regional train is cancelled before departure. Passenger information must retain the cancellation even when an older delay report arrives later. Completion requires technical and business evidence.

Two reports with source versions 8 and 9 arrive in both orders: version 9 remains visible; version 8 is retained in history and does not overwrite the display. The exercise specifies the input and expected result.

Alternative considered
An initial end-to-end path limited to lists and forms postpones the critical state checks.
Trade-off
The first end-to-end path needs controlled concurrency and failure points.
Reassess
Passing the counterexample tests and checks with readers provides grounds for extending the case.

Try it yourself

Choose two architectural decisions: concurrency protection and evidence-backed completion. For each, name the test, expected result and step to revisit.

A hint for your attempt

Link the markers of the overall architecture with the associated design steps.

Compare with a possible solution
Concurrency control
Two reports with source versions 8 and 9 arrive in both orders: version 9 remains visible; version 8 stays in history and does not overwrite the display. The invariant must hold: a confirmed cancellation for the same service and operating day remains effective until an explicitly authorised newer correction exists. A failure leads back to step 5 and the command contract in step 4.
Test completion and retries
Starting point: the train service is cancelled; its successful cancellation command and result are stored. Archive it after reconciling the operating day. Replay the identical old command, then send a new cancellation command. Expected result: replay returns the original evidence; the new command receives a conflict; status remains archived and the number of effective cancellation decisions stays unchanged. Failures lead back to step 9 for responsibility and step 7 for the failure sequence.

Apply to your project

Which two counterexample tests will you run first in your own end-to-end implementation?

Transfer the architecture and counterexamples to the editable Markdown design template.

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

    Which evidence for a train service would originate outside the application in your own project?

    In the example: The operating day is part of a train service's identity. A regional rail line with dated services, stops and manually confirmed cancellations.

  2. Requirements

    Which rule of your project remains binding even with slow processing?

    In the example: Every forecast includes freshness information. An actual-status report is current at age < 90 seconds; at 90 seconds, its timestamp is shown as stale.

  3. Scale estimates

    Which individual entity concentrates more load than the daily average suggests in passenger information?

    In the example: Test a hotspot on a single train service separately. An average of 1 event/s says little about 100 reports for the same train service arriving out of source order.

  4. Interfaces

    Which input fields make two change intentions different in your project?

    In the example: Source versions take precedence over arrival order. The operating day, train service, source version and cancellation reason must remain identical on replay.

  5. Data and states

    Which states must remain protected in your model against late replay?

    In the example: Cancellation history retains the reason for each correction. After archiving, a new cancellation command causes a conflict; an identical old retry returns its original result.

  6. Overall architecture

    Which planned service boundary would distribute a currently local guarantee across the network?

    In the example: Train service status and the display projection run separately. Train service status, source reports and cancellation history must express the same valid state.

  7. Critical flow

    What feedback could be missing even though the underlying action has already taken place?

    In the example: Store the cancellation before publishing it. A confirmed cancellation for the same train service and operating day remains effective until an explicitly authorised newer correction exists.

  8. Bottlenecks and trade-offs

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

    In the example: Reject outdated reports during projection. A fast API can deliver stale passenger information: source age, processing lag and display version are measured separately.

  9. Operations and security

    Which open state in your project needs a domain specialist as well as technical operations?

    In the example: Assign feed gaps to the responsible dispatcher. After archiving, a new cancellation command causes a conflict; an identical old retry returns its original result.

  10. Final design

    Which two counterexample tests will you run first in your own end-to-end implementation?

    In the example: Test a cancellation followed by a late delay report end to end. Two reports with source versions 8 and 9 arrive in both orders: version 9 remains visible; version 8 is retained in history and does not overwrite the display.