Data and states
Generations prevent mixed timetable versions. Which conditions ensure a valid result?
A new import reaches the platform during ongoing searches.
Starting point queryKey binds the input and completed response version.
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.
Pinned generation
bound graph generation
A running request reads exactly one graph generation and its real-time snapshot; activation affects only new requests.
State transitions and completion
| Starting point | Condition and effect | Subsequent state |
|---|---|---|
| Started | Search space fully explored and at least one valid connection fully assessed | Result |
| Started | Search space fully checked without permissible path | No route |
| Started | Budget reached, full candidates available | Partial result |
| Started | Time budget reached with no fully validated candidate | Timeout |
Started
- Condition and effect
- Search space fully explored and at least one valid connection fully assessed
- Subsequent state
- Result
Started
- Condition and effect
- Search space fully checked without permissible path
- Subsequent state
- No route
Started
- Condition and effect
- Budget reached, full candidates available
- Subsequent state
- Partial result
Started
- Condition and effect
- Time budget reached with no fully validated candidate
- Subsequent state
- Timeout
Generations prevent mixed timetable versions.
Activation atomically swaps a pointer.
A new import reaches the platform during ongoing searches.
If A activates generation 8 first, B receives a conflict and must revalidate against 8. If B activates 8 first, A receives a conflict. Neither activation is partial.
- Alternative considered
- Overwriting individual stops during a search mixes data versions.
- Trade-off
- Old generations are preserved for ongoing requests.
- Reassess
- Storage pressure requires cleanup of old generations.
Try it yourself
Predict the winner when imports A then B, and B then A, both start from generation 7.
A hint for your attempt
A new import reaches the platform during ongoing searches.
Compare with a possible solution
- A first
- A activates generation 8; B receives a conflict and must revalidate against 8.
- B first
- B activates generation 8; A receives a conflict. Neither activation is partial.
Apply to your project
How does this principle apply in your own project: Generations prevent mixed timetable versions.