System Design Atlas

Multimodal journey planning

04 / 10Worked example

Interfaces

New data requires a new search. Which conditions ensure a valid result?

A repeat call can arrive after a timetable change.

Starting point Test overall load and origin-destination hotspots separately.

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.

Four response classes

Four response classes

ResultComplete search + route
No routeComplete proof
Partial resultBudget + Candidates
TimeoutNo candidate

A fully explored search space establishes a result or no route; an exhausted time budget yields only partial results or a timeout.

A completed search yields a result or no route; reaching the time budget yields partial results or a timeout.

Proposed domain contracts

  1. POST/reisesuchen

    Start travel search with fixed data.

    Input
    queryKey, originStop, destinationStop, departureInstant, accessibilityNeeds, maxTransfers
    Result
    Alternatives, snapshotId, generatedAt, realtimeAge and complete/partial/no-route/timeout.
    Retry behaviour
    The same queryKey and payload return the same frozen response. A new search requires a new key.
  2. POST/fahrplanstaende/aktivierungen

    Activate validated import.

    Input
    importHash, baseGeneration, validityInterval
    Result
    New generation or version conflict.
    Retry behaviour
    The same import is activated once; a changed payload under the same key causes a conflict.

Try it yourself

Compare replaying Q-41, reusing its key with a changed destination, and explicitly starting a new search.

A hint for your attempt

A repeat call can arrive after a timetable change.

Compare with a possible solution
Replay
Identical content returns the stored result; a different destination causes a conflict.
New search
A new key binds the current snapshot and may return different alternatives.

Apply to your project

How does this principle apply in your own project: New data requires a new search.

Step 5: Generations prevent mixed timetable versions. Which conditions ensure a valid result?