The overall architecture
Imports and queries have separate runtimes. Which conditions ensure a valid result?
Validation of large timetables must not block the search.
Starting point Activation atomically swaps a pointer.
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.
Import and search in parallel
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.
Responsibilities within the application
Search worker modules
Route finding, transfer checks, real-time matching and result ranking use the same snapshot.
Runtime components and authoritative data
- Runtime boundary
- Journey interface → journey information API → search worker pool → immutable timetable graph and real-time snapshot. Transport data provider → import process; the import process writes a new graph generation and activates it through an atomic pointer update. The response cache stores only results keyed by the complete snapshot and preference set.
- Module responsibilities
- Timetable import validates stops, services and time references. Journey search finds connected routes in the selected data version. Real-time matching associates changes with specific services. Result ranking orders valid alternatives and explains uncertainty.
Imports and queries have separate runtimes.
The import process and search worker write and read versioned artifacts respectively.
Validation of large timetables must not block the search.
Provider → import process → new graph generation → atomic activation pointer. API → search worker → pinned graph/real-time snapshot → response cache with a complete key.
- Alternative considered
- Import in the request process couples response time to data delivery.
- Trade-off
- Additional processes increase operating expenses.
- Reassess
- Very small datasets may allow import and search to share a process.
Try it yourself
Draw the write and read paths, including their datastores.
A hint for your attempt
Validation of large timetables must not block the search.
Compare with a possible solution
- Write path
- Provider → import process → new graph generation → atomic activation pointer.
- Read path
- API → search worker → pinned graph and real-time snapshot → response cache with a complete key.
Apply to your project
How does this principle apply in your own project: Imports and queries have separate runtimes.