Menu

Two stores, one truth: building a reconciliation worker that keeps Druid and SQL in sync without hurting either
📰

Two stores, one truth: building a reconciliation worker that keeps Druid and SQL in sync without hurting either

DEV Community: dotnet·Ibad Ahmed Khan·about 8 hours ago
#CaebOQCz
#devtodotnet#devto#dev#telemetrystaging#chunk
Long article (2134 words) — no AI summary yet.
Reading 0:00
15s threshold

If you stream the same events into two different stores, they will drift apart. Not "might". Will.

On a national-scale vehicle telemetry platform I work on, live GPS data flows through Kafka into Apache Druid, which powers real-time alerting and analytics. A relational SQL database sits next to it for reporting and the parts of the product that want normal tables and joins. Both are supposed to tell the same story.

This post is about the worker I built to make sure they actually do: a daily job that finds gaps, replays the missing data in throttled chunks, proves the fix worked, and never runs twice at the same time. The code below is a simplified version of the approach with example table and column names, in C# and SQL Server, but the design applies to any pair of stores.

Why two stores drift

Every one of these will happen eventually in a streaming system:

No shared transaction. Writing an event to Druid and to SQL are two separate operations.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.