A Debezium deployment can run for months and still lose data on a bad day. The loss is almost never in Debezium's capture logic. It sits in four places, and a support engineer should be able to tell you which one you have.
The retention gap. Debezium reads the database's change log from a saved position. If the log is purged before the connector reads it, the position no longer exists. On MySQL, binlogs expire by time; on PostgreSQL, the slot keeps WAL until it is confirmed (and fills the disk instead); on Oracle, archived redo logs are removed by the DBA's retention policy; on SQL Server, the cleanup job trims change tables. Each source has a different failure shape, and each needs retention set against the longest outage you must survive, not the typical one. An alert on the age of the oldest unread log, compared with connector lag, is the cheapest protection. When the gap has already happened, the recovery is a snapshot, and the question becomes how much of the data needs one. Incremental snapshots with a signalling table backfill only what is missing without stopping streaming.
The schema history gap. Relational connectors rebuild table structure from a schema history topic. Set its retention to infinite, use one partition and the replication factor of Connect's other internal topics. If it has lost records, schema-only recovery is safe only if no DDL happened while the connector was stopped. That condition is easy to get wrong, so we write it into a runbook.
The ordering and duplication gap. Debezium guarantees at-least-once delivery per connector. After a restart, the last events before the offset flush are delivered again. Consumers that write to a target must be idempotent, keyed on the primary key, and apply an event only if its source position is newer than what is stored. Ordering for one row is kept when all events for that key reach the same partition or queue and one consumer handles them. On RabbitMQ that means a routing key per table and a queue with one active consumer where order matters; on Kafka it means the message key. Poison events need a dead-letter path, or one unparseable event stops everything behind it.
The transport gap. When the broker restarts, the connector's behaviour depends on the sink. Kafka Connect retries through producer settings and the worker's error tolerance. Debezium Server retries per sink and keeps offsets in a file or store you must put on persistent storage. A restart test with the connector, broker and consumer taken down in turn shows which pieces survive. We run that test before go-live, not after the first incident.
What this means for support. When a Debezium incident starts, we ask five questions before touching a setting. How far behind is the connector, and since when? What is the oldest log the database still holds? Is the schema history complete? Are duplicates reaching the consumer, or are events missing? What changed in the last day: DDL, a restart, a Connect upgrade, a batch job? The answers decide whether it is a lag problem, a retention problem or a design problem. Support that cannot read the database side has to guess at the first question; ours does not. We also decide, with you, whether Kafka is the right transport at all: American National Insurance judged Kafka too complex for its SQL Server CDC use case, and the use case below shows the alternative AceMQ designed.