If your data gets into a messy state, you can reconcile it.
The reconciliation pattern is:
- Schedule a job on an interval (daily, hourly, etc).
- Query trusted data to identify records in a bad state.
- Publish repair events to a log.
- Let a log processor apply each repair idempotently.
One way to apply this pattern is to have Airflow schedule a job that uses Trino to identify the bad records from your data lake (e.g., Ceph object storage with Apache Iceberg tables), then publish repair events into Kafka, and have an online processor like Flink reconcile the datastore (e.g., MySQL). Change data capture closes the loop: Debezium streams the repaired rows from the datastore through Kafka, and an indexer writes them back into the lake.
