Digital twin · merged platform · proposed
One platform for both use cases.
Transfer analysis runs at night on fare taps and stop visits; anomaly detection runs every five minutes on live feeds and loads. Drawn apart, each stands alone. Drawn together, they share more than half their parts. This page proposes the merge: one platform per agency, one exchange at the region, and three views of it, the AWS architecture, the system design and the data architecture, each tagged with the path every part serves. Nothing here is decided; the two use cases stay the deliverables.
The AWS architectureThe system designThe data architectureBrowse
- 19components serve both paths, drawn once: the agency's adapter, Bronze and Silver, key and bus; the region's poller, lane, archive, registry, regional table, front door, off-boarding and the shared parts
- 17serve the online path only: rules, the delay and load calculator, metrics and the detector, the alert builder, bus, dispatcher and log, the control rooms
- 15serve the offline path only: the fare export, the counting job, the totals outbox, the in-place reader, the inbox, check and add-up, the arrivals and catalogue, the query engine, the planners
- 0new numbers: the merge is a desk exercise on the two specifications, costed nowhere yet
What the merge buys.
The two designs already used the same names and rules for everything they share, so merging them is a matter of drawing each shared part once and pointing both paths at it.
At the agency
- One adapter, published by the region, with a batch job for the nightly conform and a stream function for the 5-minute loads.
- One Bronze and one Silver in TIDES shapes: stop visits, trips and fare taps side by side; both paths read the same Silver.
- One key on the totals, the inbox file and the rows at the region; one revocable grant serves both readers.
- One event bus where alerts arrive and the agency routes them as it likes.
At the region
- One registry of parties, feeds, both contracts, operator names and shared stops.
- One poller that writes the live lane and the feed archive, at two layers: Bronze as polled for the arrivals, Silver
vehicle_locationsfor replays. - One inbox and contract check, one catalogue and grants, one query engine, one alert dispatcher, one audit log, one monitoring, one front door for reports and the alert feed.
- One off-boarding job: revoke the grant, stop polling, delete rows, alarms, state and archive part, rebuild both reports.
The idea, in a phrase
- A fast path for what must be known now, and a slow path for what must be exact, both reading one store: the speed layer and the batch layer (the technical term: Lambda architecture).
- The alternative is one streaming path that also builds the nightly totals (Kappa architecture). We do not take it: the totals need the card hash and the privacy rule at home, which a stream at the region must never see.
What stays separate.
Each path keeps the parts only it needs. The pictures show them with a tag, and a filter shows one path at a time.
- Online only
- The rules and the vehicle state, the delay and load calculator and the timetables it reads, the metric store and its bands, the alert builder, bus, dispatcher and log, the who-is-affected lookup, the control rooms. Weather and events stay dashed and uncosted.
- Offline only
- The fare export, the counting job and the in-place read of another agency's arrivals, the totals outbox and the nightly file, the inbox, the contract check and the rejected-file queue, the add-up job, the arrival-deriving job and the catalogue, the query engine, the planners and the journey view.
- What crosses
- The union of the two contracts and nothing more: the public feeds and timetables in, the 5-minute loads in, the nightly totals in, the public arrivals read back, alerts and the alert feed out, reports and a rejected file's reason out. The public feed and the totals file cross once and serve both.
- Cost
- No merged bill is drawn. What both paths share is paid once: in the two cost pages, the shared parts, the poller, the archive and the adapter's key appear in both bills. The merged picture says which lines those are; it does not add them up.
Open.
Questions the merge raises and does not settle. Each is also listed on the view that raises it.
- One Silver, two write cadences. The online path sums
stop_visitsevery five minutes; the offline count reads them nightly. The conform step must then run continuously for both, which neither use case drew. - Shared Silver retention. Both contracts leave the agency's Silver under "the agency's rule"; if the two contracts ever name different retentions for one table, which wins.
- One service-day definition. Fare taps before 04:00 sit on the calendar date; positions take the feed's start date. Six agencies adding up need one rule.
- One regional layout for alerts and totals. The alert log is a key-value log by party and month; the regional totals are an Iceberg table by party and day. Whether they should share one layout under one key policy.
- One stream buffer for both. The lane carries positions and loads today; running the archive's trip updates through it too changes its cost, which only the anomaly bill prices.
- Catalogue and grants in the online path. The nightly lookup reads the regional table by grant, which the merged picture routes through the catalogue; the anomaly picture alone did not draw it.
Status.
- Proposed
- Decision 62, the merge itself; 63, one agency-side platform; 64, one regional exchange; 65, the speed and batch layers on one Silver, Kappa not taken. All proposed, none agreed.
- Built from
- The two detailed pictures, the two system designs and the two data architectures, imported read-only and merged by scripts, so every shared part is pinned: a drift between the two use cases fails the merged build.
- Consistent with
- Decisions 4 to 7, 13, 14, 41 to 43, 50, 54 and 59 to 61, which already made the shared parts the same thing in both use cases.
- Not done
- No cost model, no sample replay on one stream, no change to either use case's own pages.