A Verified Theoretical Basis for Incremental Snapshots in Debezium and Flink CDC

In 2019 we introduced DBLog, a Change-Data-Capture (CDC) framework developed at Netflix, to capture real-time database changes and propagate them to downstream systems like Elasticsearch and cache clusters. In addition to live change capture from a commit log, downstream systems often need the full state of a source, and not only as an initial one-time copy. A fresh copy is needed to get previously skipped data (like a table you thought you could exclude) and for repairs. DBLog addresses these requirements by copying a full table or specific keys in chunks and by interleaving them with log events without stalling the change event stream. In order to prevent chunk data from overwriting more recent log events, each chunk read is bracketed by two watermark writes.

Over the following years, this chunked watermark approach inspired teams across the open-source CDC ecosystem. In 2021, Debezium adopted the concept for its incremental snapshots, later adding read-only modes for MySQL and PostgreSQL that require no database writes. Apache Flink CDC adapted the approach in that same year, reading chunks in parallel and merging log events directly into chunk buffers.

The question is now, despite their differing mechanics, do these systems guarantee the same outcome without stale overwrites and what theoretical principles make them work ?

In my recently published paper, Generalized DBLog: A Verified Contract for Interleaving Copied Rows with a Change Log, I provide that verified theoretical basis. The paper formalizes a generalized contract that connects the original DBLog mechanism with its adaptations in Debezium and Flink CDC. Using machine-checked verification in Isabelle, Lean, and TLA+, the paper proves that all of these variants satisfy the contract and that any system satisfying it delivers the same guarantee: a virtual cut.

This post examines the verified theory behind incremental snapshots from a practitioner lens. It covers how DBLog established the baseline, how Debezium and Flink CDC adapted the mechanism, the generalized contract that unites them, what a virtual cut is and why it holds across all the variants.

Newcomer Context: Copying a live table is tricky

If you are new to DBLog and incremental snapshots you may be wondering why all of this is needed.

Because transaction logs have limited retention, they cannot retain the complete history of a source indefinitely. As a result, when bootstrapping a new downstream system, adding a table to an existing pipeline, or repairing corrupted state, the existing table data must be copied directly from the source database.

However, merging a point-in-time copy with an active change stream introduces several challenges:

  • Missed updates: If there is a gap between the point the table read executes and the point where log streaming begins, any changes committed in that interval are lost. Downstream state remains stale until those rows are updated again.
  • Stale overwrites: If a row is copied from the table and applied downstream after a newer change log event for that same row has already been processed, the older copied state overwrites the newer update.
  • Deleted row resurrection: If a row is deleted at the source while the table copy is in flight, an older copied version of the row can arrive downstream after the delete, resurrecting the removed row.

Traditional solutions avoid these issues by coordinating the copy through locks or long-running transactions. For example, a global read lock or table lock can be acquired while recording the matching log position, ensuring that log consumption starts precisely where the snapshot ends.

When we designed DBLog at Netflix, stalling real-time event processing was not an option. We required a solution that could capture data on demand, for all tables, a single table, or specific keys, while application writes and real-time CDC continued without interruption. Additional criteria were minimal impact on the source database and the ability to backfill at any time, not only as a one-time operation.

However, if bootstrapping a sink as quickly as possible matters most, then a classic pause-writes-or-events approach with a full table dump and load can be the better approach.

The Baseline: DBLog

DBLog reads tables in chunks ordered by primary key and uses a low and high watermark to bracket each chunk read. Watermarks are implemented by writing updates to a dedicated single-row table that DBLog maintains on the source database. Each update of the watermark table produces an ordinary change event that appears in the database’s change log. These events serve as markers in the log stream that DBLog detects during its processing.

Timeline diagram showing DBLog’s watermarking algorithm on a single chunk. The source database timeline shows a low watermark write, a SELECT query reading keys k1, k2, and k3 into memory, and a high watermark write. In the change log below, the resulting ‘lo’ and ‘hi’ events bracket a window containing changes for k7, k2, and k5. In the chunk buffer, key k2 is crossed out and marked dropped due to the k2 update in the window. The surviving keys k1 and k3 are emitted right after the high watermark.
Figure 1: The original DBLog algorithm. In this example, the SELECT runs at a log position between lo and hi. Selected rows whose keys show up inside the window are dropped, because the log carries the latest version of them.

For each chunk, DBLog executes the following steps:

  1. Briefly pause log event processing.
  2. Write the low watermark update to the watermark table.
  3. Execute a SELECT to read the next chunk into memory.
  4. Write the high watermark update to the watermark table.
  5. Resume log event processing. From the low watermark event onward, check each change log event: if its primary key matches a row in the buffered chunk, remove that row from the buffer. The change log event itself is forwarded downstream as usual.
  6. When the high watermark event is received from the change log, emit all remaining rows from the chunk buffer to the output writer before resuming normal log event processing.

Figure 1 illustrates this process for a chunk containing keys k1, k2, and k3. The log position at which the SELECT query executed against the database storage engine is unknown. Because the read occurred after the low watermark transaction committed and before the high watermark transaction committed, its execution point is guaranteed to lie within the window bounded by the two watermarks, as long as commits become visible in change log order.

This boundary is all that is needed to make sure no copied row overwrites a newer change:

  • If a row changes within the window (such as k2 in the figure), the change log carries a committed event that reflects the newer state. The copied row in memory is dropped, allowing the change log event to update downstream state.
  • If a row does not appear in the change log between the watermarks (like k1 and k3), the row was not modified while the chunk was being read. Its state at the end of the window is identical to its state when read, making it safe to emit after the high watermark.
  • Change events for rows outside the current chunk (such as k5) simply pass through to the output.

Operating in chunks provides several practical advantages. The pause on log processing during steps 1-4 is brief because watermark updates and chunk reads are lightweight operations. Also, chunk processing can be throttled, paused, resumed after failures, or targeted at specific subsets of data without restarting the entire table dump.

Debezium’s approach

Debezium adopted the DBLog chunking mechanism in version 1.6 under the name incremental snapshots. The initial implementation does windowing by writing to a signaling table. In version 1.7, Shopify contributed a read-only mode for MySQL that uses GTID sampling instead. In version 2.7, Debezium added a read-only mode for PostgreSQL that samples the server’s transaction snapshot.

Signal-Table Mode

In this mode, Debezium integrates the watermark concept with its existing signaling table infrastructure. The signaling table is a captured table used to send operational commands to the connector.

When an incremental snapshot is triggered, the connector does these steps:

  1. Insert a snapshot-window-open record into the signaling table.
  2. Execute a SELECT to read the chunk into memory.
  3. Insert a snapshot-window-close record into the signaling table.

Both signal inserts appear as change events in the database change log. As log processing advances, Debezium identifies the open event and begins monitoring change events against its buffered chunk rows. Any row updated or deleted between the open and close signals is removed from the buffer. Once the close signal arrives, the surviving rows are emitted to the output stream.

Debezium also provides an alternative insert_delete strategy. In this mode, the connector inserts a signal row to open the window and deletes that same row to close the window, avoiding row accumulation in the signaling table.

Timeline diagram of Debezium’s signal-table incremental snapshot mode. The connector inserts ‘snapshot-window-open’ into the signaling table, executes a SELECT for chunk keys k1, k2, and k3 into memory, and inserts ‘snapshot-window-close’. The signal inserts appear in the binlog as ‘open’ and ‘close’ change events defining the window. Key k2 is updated inside the window and dropped from memory, while the surviving keys k1 and k3 are emitted downstream right after the close event.
Figure 2: Debezium's signal-table mode. The window edges are rows Debezium inserted into its signal table and then read back from the binlog, like DBLog's watermarks.

Read-Only Mode

In some production environments, giving a CDC connector write access to the source database may be prohibited by policy. The read-only mode was built for such cases.

Rather than writing marker rows to the database, the read-only mode establishes DBLog’s window by querying MySQL’s transaction coordinate state directly. Here, chunk selection works by executing these steps:

  1. Before reading the chunk, run SHOW MASTER STATUS (or SHOW BINARY LOG STATUS in MySQL 8.2+) to record the currently executed Global Transaction Identifier (GTID) set as the low boundary (low).
  2. Execute the chunk SELECT and store its result into memory.
  3. Run SHOW MASTER STATUS again to record the executed GTID set as the high boundary (high). The difference between the two sets represents all transactions that committed while the chunk read was in flight.

During binlog processing, every event carries the GTID of its containing transaction. The connector compares each event’s GTID against the two sampled sets:

  • An event whose GTID is not contained in low indicates that the window has opened.
  • An event whose GTID is contained in high falls within the window. If its key matches a buffered chunk row, that row is dropped from memory (such as k2 with transaction ID 44 in the figure below).
  • Once the window is open, an event whose GTID is not contained in high closes it. The surviving rows are emitted before that event is forwarded.

If the source database has low write traffic and no user transactions commit to close the window, MySQL server heartbeat events let the connector close the window.

Timeline diagram of Debezium’s read-only snapshot mode on MySQL. The connector runs ‘SHOW MASTER STATUS’ before and after selecting chunk keys k1, k2, and k3 to record executed GTID sets (low: transactions 1–42, high: transactions 43–45). In the binlog, transactions 43 through 45 form the window. Key k2 is dropped from memory because transaction 44 updated it within the window, and the surviving keys k1 and k3 are emitted once the window closes at transaction 46.
Figure 3: Debezium's read-only mode on MySQL. The connector samples the server's executed GTID set before and after the chunk read and checks every binlog event against the two samples.

Debezium also implements a read-only mode for MariaDB. MariaDB reports GTID_BINLOG_POS, a per-replication-domain position rather than MySQL’s complete executed set, and the connector samples that value instead. The connector brackets the chunk read between two samples of that value in the same way.

PostgreSQL has no executed GTID set to sample. Its read-only mode, available for PostgreSQL 13 and later, calls pg_current_snapshot() before and after the chunk SELECT instead. Each sample describes which transactions had completed at that moment: xmin is the oldest transaction still running, and xmax is one past the highest transaction ID that has completed. During write-ahead log (WAL) processing, every event carries the ID of its containing transaction. The connector compares each event’s ID against the two samples:

  • An event whose transaction ID is at least the low sample’s xmin indicates that the window has opened.
  • While the window is open, if an event’s key matches a buffered chunk row, that row is dropped from memory.
  • An event whose transaction ID is greater than the xmax of both samples indicates that the window has closed. The surviving rows are emitted before that event is forwarded.

A transaction that was still running when the low sample was taken cannot have an ID below that sample’s xmin. A transaction whose ID is above the high sample’s xmax cannot have completed before the high sample was taken. As long as the two samples line up with the stream the connector is reading, the two comparisons can therefore only make the window wider, never narrower. A wider window only drops a few more copied rows, and the log carries the latest version of those rows anyway.

Apache Flink CDC’s MySQL connector adapted the DBLog protocol for distributed, parallel execution in stream processing pipelines. Flink CDC introduces two major modifications to the original design: chunks are read concurrently by parallel workers, and conflicting change events are merged directly into chunk buffers rather than dropped.

Parallel Chunk Reading and In-Memory Merging

In Flink CDC, the source table is split into disjoint primary key ranges (splits) during initialization. These chunks are assigned to parallel snapshot reader tasks.

As shown in Figure 4, each reader processes a chunk using four steps:

  1. Query the database to obtain the current binlog offset and record it as LOW. With GTIDs enabled the offset is the executed GTID set, otherwise the binlog file and position.
  2. Execute the SELECT to fetch the chunk rows into an in-memory buffer.
  3. Query the binlog offset again and record it as HIGH.
  4. Read the binlog between LOW and HIGH for events belonging to the chunk’s primary key range, and merge those changes directly into the buffer. An update event replaces the corresponding buffered row, and a delete event removes it.

Once the reader completes this local backfill, the buffer reflects the state of all keys in that chunk as of its specific HIGH offset. The chunk is then emitted downstream as insert events.

Process and timeline diagram of Flink CDC’s snapshot phase. Two parallel readers process disjoint key ranges: Reader A for keys k1-k3 and Reader B for keys k4-k6. Each reader samples local LOW and HIGH binlog offsets around its chunk SELECT, then reads the binlog between LOW and HIGH to merge changes directly into its memory buffer. Below, the change log shows overlapping offset windows: Window A merges event k2 into chunk 1, while overlapping Window B merges event k5 into chunk 2 and ignores k2.
Figure 4: Flink CDC's snapshot phase. Every chunk carries its own window and the windows may overlap. Changes inside a window are merged into the chunk before it is emitted. q marks an event for a row outside both chunks.

Notice that the window boundaries in Flink CDC are recorded binlog offsets, not marker rows written to the database log. While Flink CDC’s codebase uses the terms low and high watermarks, these are internal markers within Flink’s runtime dataflow, not writes to the database. Because chunks are assigned to independent parallel readers, their offset windows overlap freely in the binlog. This concurrency is safe because each reader filters the binlog strictly for keys within its assigned chunk.

The Streaming Phase Gate

Once all parallel chunk reads are complete, Flink CDC transitions to a streaming phase where a single binlog reader tails the database log continuously.

Because each chunk was finalized at its own HIGH offset, different chunks reflect the database state at different points in the log. To ensure no changes are missed, the streaming reader starts reading from the minimum HIGH offset across all completed chunks.

Starting at this earlier offset means the reader will encounter events that have already been merged into chunk buffers. To prevent applying older changes over newer data, Flink CDC applies a gating mechanism to every incoming binlog event:

  • For each event, the reader identifies which chunk owns the event’s primary key.
  • If the event’s binlog offset is less than or equal to that chunk’s HIGH offset, the event is discarded because its state is already incorporated into the emitted chunk (such as k5 at or before HIGH_B).
  • If the event’s offset is strictly greater than that chunk’s HIGH offset, the event is emitted downstream (such as k1, k6, and k3).
Timeline diagram illustrating event gating in Flink CDC’s streaming phase. The single binlog reader begins reading at the earliest chunk boundary, HIGH_A. An incoming event for key k5 occurring at or before HIGH_B is skipped because its state was already merged into chunk 2. Subsequent events occurring strictly past their chunk’s HIGH boundary (k1 and k3 past HIGH_A, and k6 past HIGH_B) are emitted downstream.
Figure 5: Flink CDC's streaming phase. The binlog reader starts at the smallest HIGH and skips any event still at or before the HIGH of the chunk that owns its key, because the merged chunk already has it.

Flink CDC also provides an option to skip the per-chunk binlog backfill. However, Flink’s documentation notes that this mode provides only at-least-once semantics, and it does not satisfy the guarantees discussed below.

Unifying the family with Generalized DBLog

While Debezium and Flink CDC developed different operational mechanics, the paper shows that both systems, along with the original DBLog, implement the same core abstraction. This abstraction is now formalized as the Generalized DBLog contract, structured around four foundational rules:

  1. Disjoint Partitioning: The target dataset is partitioned into disjoint, non-overlapping key ranges (chunks, tables, or discrete key sets).
  2. Windowing: For each partition, the system establishes a lower and an upper boundary in the change log that enclose the point-in-time read of the chunk. These boundaries can be established by writing watermark rows, sampling server GTID or transaction state, or recording log offsets.
  3. Log Wins: Any change log event occurring within a chunk’s window takes precedence over the copied chunk data. Whether a system drops the copied row (as in DBLog and Debezium) or merges the change event into the chunk buffer (as in Flink CDC), the resulting row state is equivalent.
  4. Window Completion: A partition’s data is only released to downstream consumers after all change events within its window have been fully processed.
Comparison table illustrating the Generalized DBLog protocol family across five approaches: Classic DBLog, Debezium signal-table, Debezium read-only, Flink CDC, and Exact-position dumps. For each approach, the table diagrams how window boundaries are demarcated in the change log (‘lo’/‘hi’ marker events, ‘open’/‘close’ signal events, sampled GTID boundaries, recorded binlog offsets, or zero-width exact positions) and how concurrent changes inside the window are reconciled (dropping copied rows in DBLog and Debezium, merging changes into chunk buffers in Flink CDC, or requiring no reconciliation for exact dumps).
Figure 6: The family in one picture. q marks events for other rows, k the copied row that changed inside the window.

Figure 6 illustrates how these systems form a cohesive protocol family based on the same principles:

  • Classic DBLog: Watermark rows written to a dedicated table define the window. Conflicting copied rows are dropped.
  • Debezium Signal-Table: Command rows written to the signal table define the window. Conflicting copied rows are dropped.
  • Debezium Read-Only: Sampled GTID sets (MySQL, MariaDB) or transaction snapshots (PostgreSQL) define the window without database writes. Conflicting copied rows are dropped.
  • Flink CDC: Binlog offsets define the window. Change events within the window are merged into the chunk buffer before emission.
  • Exact-Position Dumps: Tools like mysqldump (with --single-transaction --source-data), mariadb-dump, pg_dump with an exported replication snapshot, or Debezium’s initial snapshot represent a degenerate case where window width is zero (LOW = HIGH). Because the read corresponds to an exact log coordinate, there are no concurrent changes to reconcile.
  • Bounded Restores: A restored database backup whose commit position is unknown but bounded between known start and end log positions behaves as a wide window. Applying the change log from the start boundary and discarding restored rows modified between the two boundaries satisfies the same contract.

Because chunks are processed independently, these strategies can be composed within the same system. For example, a pipeline could perform an exact-position snapshot for one table, execute watermark-based chunking on another, and restore a third table from a backup, with the same guarantee holding across all three.

What you get: a virtual cut

The central contribution of the Generalized DBLog paper is establishing the guarantee downstream consumers receive when these rules are followed.

Even though chunks are read at different points in time, without global table locks and without pausing concurrent write traffic, replaying the emitted stream reconstructs the state of the source database at a single point in the change log: a virtual cut.

It is worth clarifying where this cut is constructed and stored. While a chunk window is open, DBLog holds the chunk buffer and the window boundaries. Once the window closes and the surviving rows are emitted, the buffer is gone. There is no snapshot and no cut record inside the connector, and the same is true for Debezium and Flink CDC. The cut is a property of the stream these systems emit, and it turns into concrete rows only where that stream is applied: in the sink table, in a consumer that folds the topic into a table, or in a test that replays the output into a map. That is what virtual means. The state exists only as the result of replaying the stream, which is why the approach is cheap at the source and why it needs a proof.

Diagram showing virtual cut progression (f to f’ to f″) across four keys (k1 to k4). Chunk 1 reads k1 and k2 between lo_1 and hi_1, dropping k2 due to an in-window update to B’, establishing partial cut f with {k1: A, k2: B’}. Chunk 2 reads k3 and k4 between lo_2 and hi_2, dropping k4 due to an in-window delete. At cut point f’ after hi_2, all keys are covered, yielding a virtual cut of {k1: A, k2: B’, k3: C}. A subsequent log update to k3 (C’) advances the virtual cut to position f″.
Figure 7: Virtual cut progression (f→f’→f’’) across two chunk reads and one update. Reading down any cut line gives exactly the rows the database had at that log position. q marks an event for a row outside the scope.

In this context, “replaying” means applying the emitted stream, both chunk rows and change log events in the order they were produced, to a downstream store using a latest-event-wins policy per primary key. The sink only needs to upsert on chunk rows and update events and delete on delete events. It does not need to know where the windows were, when the chunks were read, or which rows came from a chunk and which from the log.

Figure 7 demonstrates how a virtual cut materializes across four keys (k1, k2, k3, k4) and how it progresses:

  1. Chunk 1 reads keys k1 and k2 between watermarks lo_1 and hi_1. The read captures k1 = A and k2 = B. During chunk 1’s window, an application transaction commits an update setting k2 = B′. Because k2 changed inside the window, the copied row B is dropped from the chunk buffer.
  2. At cut point f (immediately after chunk 1 closes), chunk 1 emits k1 = A, and the change log carries k2 = B′. Replaying the stream up to f yields {k1: A, k2: B′}, matching the database state for those keys at log position f. Rows k3 and k4 have not yet been read, so no claim is made about them.
  3. Chunk 2 reads keys k3 and k4 between watermarks lo_2 and hi_2. The read captures k3 = C and k4 = D. During chunk 2’s window, an application transaction commits a delete for k4. The copied row for k4 is dropped.
  4. At cut point f' (after chunk 2 closes), chunk 2 emits k3 = C, and the delete event for k4 is streamed. Replaying the output up to f' yields {k1: A, k2: B′, k3: C}. This matches the state of the database at log position f' across all four keys.
  5. As log processing continues, a subsequent update sets k3 = C′ at position f''. The reconstructed state advances to {k1: A, k2: B′, k3: C′}, matching the database at f''.

A cut covers every selected key once the last window has closed and the log has been consumed up to that point (f' in Figure 7). From that position on, the sink holds what it would hold had a single snapshot over the selected scope (full table, or specific keys) been taken at that moment, even though the chunks were read separately. Until then, only the keys of completed chunks are guaranteed to match the source database, so a consumer that needs every key to match the source at one log position has to wait for that point. After that, every change event the sink applies moves the cut forward by one position (f' -> f''), so the sink always matches the source database as of the last event it applied. There is no hand-off between a snapshot phase and a streaming phase in what the sink sees.

Why the Guarantee Holds

The reason this guarantee holds can be understood by considering each row individually. For any given key, only two cases are possible:

  1. The row changed inside or after its chunk window: The change log records every modification to the row in commit order. Consequently, the latest change event at or before the cut point determines the row’s value, matching the database state at the cut.
  2. The row did not change after its read: Because no transactions modified the row between the chunk read and the cut point, the copied value was correct when read, remained correct at the end of the window, and remains correct at the cut.

There are no other cases. The validity of this argument does not depend on knowing the exact moment the SELECT query ran within the window, the duration of the window, or whether chunks were processed serially or concurrently. Once all chunks are complete and the log has been consumed through the largest high boundary, the stream establishes a virtual cut across all selected keys. Subsequent change log events advance that cut.

Scope Boundaries

Three important boundaries should be noted regarding this guarantee:

  • Row-level versus transactional: A virtual cut reconstructs the state of each row as of a specific coordinate in the change log. If a cut point falls in the middle of a multi-row database transaction, the reconstructed state will reflect the subset of rows committed up to that log offset. For the reconstructed state to contain only whole transactions, the cut must be aligned with a transaction boundary, which GTID-based coordinates provide naturally.
  • Output stream versus downstream sinks: The guarantee applies to the stream as emitted by the capture process. How downstream sinks apply that stream, including handling out-of-order delivery, network retries, and idempotency, is an orthogonal challenge. This is discussed further in an earlier blog post: CDC Doesn’t Solve Dual Writes.
  • Repairing a populated sink: The proofs assume an empty sink. Applied to a non-empty sink, the stream updates every row it carries. But a row that the source deleted before the copy started appears in no chunk and gets no delete event, so it can survive downstream. If parity with the source database matters, the pipeline must clear the sink first or emit tombstones for previously deleted rows.

Fine print

The paper analyzes the preconditions required for the Generalized DBLog contract to hold in production systems. For developers maintaining CDC connectors or implementing custom snapshot engines, the following requirements are essential:

  • Full Row Images in the Change Log: Change log update events must include the complete post-image of the row, rather than only the modified columns (like binlog_row_image=FULL in MySQL). If an update event carries only partial column changes, dropping a copied row in favor of the log event would result in missing column values downstream.
  • Stable Row Identifiers: Tables must have a primary key or immutable unique key to correlate chunk reads with log events. If a primary key is modified, the database or connector must represent this change as a delete of the old key followed by an insert of the new key.
  • Snapshot-Style Chunk Scans (Completeness): The chunk SELECT must run against a statement snapshot so that every row in the scanned range is observed. In our original 2020 paper, we stated this requirement as “non-stale reads”, meaning the scan observes changes committed prior to its execution. However, that definition is underspecified as it constrains the values of the rows that come back, not which rows come back. If a scan misses a row that never changes afterwards, no change log event will ever mention it and nothing repairs the omission. Under a locking Read Committed level, such as SQL Server’s default, shared locks are released as the scan advances, and Microsoft’s locking guide documents that a concurrent key update can move a row within the index so that the scan sees it twice or not at all. In that documented case the moved row was itself updated, so its own log event would repair it, but it shows that a lock-based scan offers no completeness guarantee. MVCC-based statement snapshots (standard in MySQL InnoDB and PostgreSQL) provide that guarantee by design.
  • Visibility in Log Order: A chunk read must also see every transaction that precedes its low watermark in the change log. MySQL guarantees this by default (binlog_order_commits). PostgreSQL does not guarantee this. It writes a committing transaction to the WAL, where it can be streamed, before other sessions can see it. So, a transaction logged later, such as the low watermark, can become visible first. This interval is normally very short, and the chunk must also contain a row that the earlier transaction changed, so the chance that a chunk read is affected is low. If it is affected however, a chunk read that starts in that interval misses the earlier transaction’s changes. Unless such a row changes again inside the window, its copied old value is emitted after the newer change and stays until the row changes again. A deleted row comes back the same way. For captures that write watermarks, the paper describes a remedy based on the read’s own snapshot (pg_current_snapshot()).
  • Sufficient Change Log Retention: The database must retain its change log from the lowest open window boundary until all active windows are closed. For Flink CDC, the log segment between LOW and HIGH must remain available until parallel workers complete their local backfill.
  • Watermarks as a Mechanism, Not a Requirement: Our 2019 framework introduced watermarks as writes to a dedicated database table. However, watermarking is simply one mechanism for establishing log boundaries. Read-only approaches prove that external coordinates, such as sampled GTID sets or transaction snapshots, can satisfy the contract without requiring write access to the source database.
  • Strict Window Termination: Buffered chunk rows must not be emitted before every change event inside the window has been processed. In read-only modes, when an ordinary change event outside the window reveals its end, the surviving rows must be emitted before that event is forwarded. Quiet database conditions (aka no changes occurred) additionally require heartbeat events to trigger window termination.
  • Flink-Specific Operational Constraints: In parallel architectures like Flink CDC, chunk partitioning keys must remain immutable during the snapshot phase to prevent rows from migrating between chunk ranges. Additionally, the stream must preserve CDC operation semantics (inserts, updates, and deletes). An append-only transport that erases operation types cannot correctly apply log precedence. Finally, bypassing the per-chunk binlog backfill reduces the delivery to at-least-once.

The paper

The formal foundation for this work is detailed in my paper, Generalized DBLog: A Verified Contract for Interleaving Copied Rows with a Change Log.

The paper defines the unified contract, proves that classic DBLog, Debezium (signal-table mode and the MySQL and PostgreSQL read-only modes), Flink CDC, exact-position dumps, and bounded restores satisfy it. It also establishes the operational conditions required by each. The theoretical development is machine-checked in Isabelle, the core virtual cut theorem is independently verified in Lean, and protocol variants are model-checked in TLA+.

There is also a dedicated section in the paper for engineers building or maintaining CDC connectors. For an animated walkthrough of how the algorithm works, start with my interactive introduction to DBLog. The earlier paper, A Theoretical Study of DBLog, establishes the formal proof for the original algorithm, while the 2019 Netflix TechBlog post introduces the original production design.