Final design
The design demonstrates consistent travel alternatives. Which conditions ensure a valid result?
A beautiful route map hides snapshot errors.
Starting point Real-time data older than 90 s is marked.
Assumptions for the example case
A fictional journey planner for buses, trains and walking routes in one region. Each response binds a timetable version and a real-time snapshot. The scope ends with journey information, without a booking commitment. All quantities, thresholds and operational objectives are illustrative assumptions.
Information with test markers
Import and search in parallel
The import activates a generation through an atomic pointer update; each request pins the graph and real-time snapshot before searching.
Test plan with expected outcomes
| Input and initial state | Expected result | Return to an earlier step |
|---|---|---|
| Active generation=7 → Import A/B and B/A respectively baseGeneration=7 | Exactly one import activates generation 8; the loser receives a conflict. Generations remain separate. | Step 5 |
| Q-41 completes with origin=a and destination=b → retry identically, then use destination=c under the same key | Same answer; altered search conflict. | Step 4 |
| Arrival 10:00, footpath 180 s, buffer 120 s → departure 10:04:59 /10:05:00 /10:05:01 | The first transfer is invalid; the other two are valid. | Step 2 |
| Budget 800 ms → No complete candidate or two complete candidates at the end of the budget | Respectively: timeout, or a partial result with exactly two validated routes. Neither proves that no route exists. | Step 7 |
Active generation=7 → Import A/B and B/A respectively baseGeneration=7
- Expected result
- Exactly one import activates generation 8; the loser receives a conflict. Generations remain separate.
- Return to an earlier step
- Step 5
Q-41 completes with origin=a and destination=b → retry identically, then use destination=c under the same key
- Expected result
- Same answer; altered search conflict.
- Return to an earlier step
- Step 4
Arrival 10:00, footpath 180 s, buffer 120 s → departure 10:04:59 /10:05:00 /10:05:01
- Expected result
- The first transfer is invalid; the other two are valid.
- Return to an earlier step
- Step 2
Budget 800 ms → No complete candidate or two complete candidates at the end of the budget
- Expected result
- Respectively: timeout, or a partial result with exactly two validated routes. Neither proves that no route exists.
- Return to an earlier step
- Step 7
End-to-end test and unresolved agreements
- First end-to-end path
- Calculate a journey with one transfer against a fixed snapshot. Activate an import concurrently, vary the transfer boundary and exhaust the time budget both with and without complete candidates.
- Clarify before real use
- Agree accessibility data, international time-zone handling, provider associations and realistic buffer rules before expanding the design.
The design demonstrates consistent travel alternatives.
The end-to-end test combines an import version switch and the minimum transfer-time boundary.
A beautiful route map hides snapshot errors.
The activation pointer and worker must preserve one data version; on failure, revisit step 5. The response path distinguishes partial results, timeout and no route; on failure, revisit step 7.
- Alternative considered
- Testing only successful standard searches leaves the critical branches untested.
- Trade-off
- Test requires controlled time and activation order.
- Reassess
- Add further modes of transport after obtaining this evidence.
Try it yourself
Associate the snapshot and time-budget tests with the relevant component and the step to revisit on failure.
A hint for your attempt
A beautiful route map hides snapshot errors.
Compare with a possible solution
- Snapshot
- The activation pointer and worker must preserve one data version; on failure, revisit step 5.
- Budget
- The response path distinguishes partial results, timeout and no route; on failure, revisit step 7.
Apply to your project
How does this principle apply in your own project: The design demonstrates consistent travel alternatives.
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
Purpose and boundary
How does this principle apply in your own project: Journey information describes a possible route.
In the example: Responses state the data version and freshness.
Requirements
How does this principle apply in your own project: Equality is sufficient for a connection in this model.
In the example: At least 300 s of transfer time is required.
Scale estimates
How does this principle apply in your own project: Peak search load differs from the daily average.
In the example: Test overall load and origin-destination hotspots separately.
Interfaces
How does this principle apply in your own project: New data requires a new search.
In the example: queryKey binds the input and completed response version.
Data and states
How does this principle apply in your own project: Generations prevent mixed timetable versions.
In the example: Activation atomically swaps a pointer.
Overall architecture
How does this principle apply in your own project: Imports and queries have separate runtimes.
In the example: The import process and search worker write and read versioned artifacts respectively.
Critical flow
How does this principle apply in your own project: Exhausting the search budget does not prove that no route exists.
In the example: Partial results contain only fully validated candidates.
Bottlenecks and trade-offs
How does this principle apply in your own project: Search expansions explain slow queries.
In the example: Measure expansion count and data access time separately.
Operations and security
How does this principle apply in your own project: Data age remains visible.
In the example: Real-time data older than 90 s is marked.
Final design
How does this principle apply in your own project: The design demonstrates consistent travel alternatives.
In the example: The end-to-end test combines an import version switch and the minimum transfer-time boundary.