Real-time data platform
A real-time data platform that cut each new AI use case from a month of pipelines to one query
Every new AI idea waited about a month for data pipelines, and the same logic lived in three places. I proposed making a streaming database the single entry point for all our fast-moving data, and led the build. Now a new use case starts with a query, at about a seventh of the old cost.
- Kind
- Production system, in daily use
- My role
- Proposed it to the directors, senior VPs and chairman, then led the build
- Team
- Data engineering migrated the pipelines on the framework I set up
- Scale
- ~2,500–3,000 trucks across Canada, the US and Mexico · GPS several times a minute
- Built for
- Every team waiting on a new AI use case
- Techniques
- data architecture, streaming database, streaming SQL, change data capture, medallion architecture, cost optimization
Results
- → to start a new AI use case
- from truck signal to usable data, even at peak
- of the old warehouse’s yearly cost
Delivered within a prior employer’s environment. Details are intentionally anonymized. I’m glad to discuss the operating problem, design principles, and production tradeoffs.
The problem
Data reached two warehouses through separate pipelines, each with its own copy of the logic, and an ML copy was on the way.
The same logic lived in three places.
A fix in one copy had to be remembered in the others, and any copy that was missed drifted quietly.
The call
Stop before the third copy, and give the logic one home.
Techniques: data architecture
Listen for changes instead of copying tables.
The streaming database takes in the operational database’s change events directly, alongside the sensor feeds.
The call
Change data capture keeps everything current, and any past state can be rebuilt.
Techniques: change data capture
Write the logic once.
All cleaning and transformation happens there as streaming SQL, and every system reads from it.
The call
Use SQL, so a team that already knew it could own a real-time system.
Techniques: streaming SQL
Keep live data fast and history cheap.
Live systems get data within a minute. History sits on low-cost storage.
The call
Only ML needed history, so it stopped paying for always-on compute.
Techniques: cost optimization
Start the next use case with a query.
Every model builds on shared, cleaned views.
The call
A new use case branches off what already exists, so nobody waits a month. Trip tracking and fuel alerts were built this way.
Techniques: medallion architecture
Real-time trip tracking that logs ~90% of pickups and deliveries with no human fix~3–4 hours of dispatcher detective work saved a day · ~2,000–2,500 trucks tracked liveRead the caseFuel-loss alerts cut from 50% false to 15%, so analysts opened them again~3–4 confirmed incidents a day in Mexico alone · ~85% of alerts confirmed by analystsRead the case
What broke first
What I tried
Our first streaming views, written the way you’d query a finished table.
What broke
Load. A streaming view never finishes and keeps state for every join, so ours held far too much and slowed at peak.
What changed
Rewrite them for a stream.
In hindsight
Train the team on streaming SQL before migrating.
Ask me about
- How I made the case to leadership
- What changes when you write SQL for a stream
- Which data moved first, and why
