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.…