Best Practices

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

This page collects the advice of the whole Database Migration section into one checklist. It follows the order in which a migration happens: preparing the plan, setting up the legacy source, loading the existing data, streaming changes, applying them in sinks and consumers, proving that the new database is right, cutting over, operating the pipeline, and finally taking it apart. Every item has a short rationale and links to the page that explains the details, so the checklist can be printed and used in reviews without repeating the reasoning.

A Debezium migration rarely fails because a property is missing. It fails because an assumption nobody wrote down turns out to be false at the worst moment: archive logs that were deleted during a long outage, a consumer that applied an old event twice, a replication slot that nobody dropped, a rollback that was never rehearsed. A checklist turns those assumptions into items that someone has to tick, and the phase structure says when they have to be ticked.

Checked on 2026-11-09 against Debezium 3.7.1.Final, Kafka 4.x in KRaft mode, Oracle AI Database 26ai Free (image gvenzl/oracle-free:23.26.3, PDB FREEPDB1), PostgreSQL 18 and Spring Boot 4.1 with Spring for Apache Kafka 4.1. The checklist and the baseline configuration are derived from the other pages of this section and from the official Debezium documentation; they were not run as a separate test.

How to use the checklist

The phases are those of Migration Patterns with CDC: snapshot and streaming, parallel run and reconciliation, read cut-over, write cut-over with reverse replication, and decommission. This page groups its checklist into nine working stages instead (preparation, source setup, initial load, streaming, consumers and sinks, verification, cut-over, operations and decommissioning), because setting up the source or the consumers is different work from running them. Where an item names an exit criterion, it refers to the migration phase of that page (for example "the parallel run"), not to a checklist stage.

Two rules apply to the whole list:

  • Track the phase per table, not per database. The Bookshop catalogue (BOOK, AUTHOR) can be in the write cut-over while ORDERS and ORDER_LINE are still in the parallel run. Keep one document that lists every legacy table, its current phase, its source of truth and the connectors that touch it, and go through the checklist per capability.

  • An unticked item blocks the next phase. If an item does not apply, write down why. "Not applicable" is a decision; an empty box is not.

The gates between the phases look like this:

flowchart LR P[Preparation] --> S[Source setup] S --> L[Initial load] L -->|snapshot notification, counts match| ST[Streaming] ST --> C[Consumers and sinks] C --> V[Verification] V -->|clean for a business cycle| CO[Cut-over] CO -->|no legacy reader or writer left| D[Decommissioning] V -->|translator bug| C CO -->|rollback| V O[Operations: monitoring, alerts, runbooks] -.-> ST O -.-> C O -.-> CO

Operations is not a phase that starts after the others. Monitoring and alerting must be in place before the first production snapshot, which is why the operations checklist is referenced from the source setup.

Preparation

Item Rationale
  • Log-based CDC is the chosen strategy, and the alternatives were rejected for written reasons

Dual writes, batch ETL, triggers and timestamp polling each lose changes or load the legacy database in ways that are hard to see. Recording why CDC was chosen keeps the decision from being reopened mid-migration. See Migration Strategies.

  • Exactly one source of truth per table at every moment

Two writers for the same rows produce loops and conflicting updates that no pipeline can resolve. The source of truth moves per table, with a short write freeze. See Migration Patterns with CDC.

  • The migration is split by capability, and each capability has an exit criterion per phase

A strangler-fig migration moves one capability at a time. Exit criteria such as "reconciliation clean for a full business cycle" make the decision to move on measurable. See Migration Overview and Feature flags and cohort-based cut-over.

  • The runtime, the apply method, the snapshot strategy and the sync direction are decided

Kafka Connect, Debezium Server or the embedded engine; a JDBC sink or a hand-written consumer; initial or no_data plus incremental snapshots; one-way or two-way. These four choices shape everything else. See Choosing a Deployment.

  • Every captured column has a data decision: migrate, exclude, truncate, hash or mask

Change events copy personal data into Kafka topics, logs and dead-letter topics, often with a longer retention than the legacy database. Deciding per column before the first snapshot is much cheaper than deleting data from topics later. See Security & Data Protection.

  • One wire format is chosen for every topic, for all of its consumers

A topic has exactly one format, set by the source connector’s converters. The JDBC Sink Connector needs the schema: with schemaless JSON it skips every record as not being a Debezium record. Bookshop therefore uses JSON with schemas enabled, which the Spring consumer of Listening to Events in Applications also reads (it unwraps the payload). Avro with a registry is the smaller alternative for production volumes. See Serialization & Schema Registries.

  • The type mapping of every legacy column is written down, including decimals, Oracle DATE and flags

NUMBER(10,2) prices, local-time DATE columns and 'Y'/'N' flags are where silent corruption starts. With decimal.handling.mode=string, every Oracle NUMBER, keys included, arrives as a JSON string ("BOOK_ID":"7"), so consumers parse strings. The mapping table is also the input of the reconciliation queries. See Data Types & Precision.

  • A lag objective is agreed (for example "a legacy change is visible in PostgreSQL within 30 seconds at peak")

Without a number, nobody can decide whether the pipeline is healthy or whether the read cut-over is safe. The objective also sizes the alerts. See Verification & Reconciliation.

  • A production-like staging environment exists, with a clone of the legacy data

The snapshot duration, the redo volume, the consumer throughput and the cut-over itself have to be rehearsed on real volumes. A lab with a few hundred rows proves only that the configuration parses. See Testing CDC Pipelines.

Archive log retention, Kafka disk, topic retention and sink throughput all depend on numbers that are only known after measuring the legacy workload.

Source setup

The legacy database

Item Rationale
  • Oracle: ARCHIVELOG mode, with archive log retention longer than the longest planned connector outage

LogMiner reads the redo and archive logs. If the logs for the stored offset SCN are gone, the connector cannot resume and the only safe recovery is a new snapshot. See Oracle Connector.

  • Oracle: minimal supplemental logging in the CDB root, and (ALL) COLUMNS logging on every captured table, including the signal and heartbeat tables

Without all-column logging an update event lacks the columns that did not change, so the sink cannot rebuild the row. A missing database-level setting shows up as ORA-00600 [flg0]. See Oracle Connector.

  • PostgreSQL: wal_level=logical, plugin.name=pgoutput set explicitly, one slot and one publication per connector

The documented plugin.name default is decoderbufs. Two connectors that share a slot split the changes between them, and each silently misses events. See PostgreSQL Connector.

  • Every captured table has a primary key, or a declared message key

The record key decides the partition, and with it the ordering per row, the upsert in the sink and the compaction of the topic. On Oracle, a table without a primary key needs message.key.columns. On PostgreSQL, a table with REPLICA IDENTITY DEFAULT and no primary key emits no update or delete events at all. See Anatomy of a Change Event and PostgreSQL Connector.

  • PostgreSQL: REPLICA IDENTITY FULL on tables whose consumers need the old values of non-key columns

With DEFAULT, the before field of an update or delete holds only the key. The reverse direction of the Bookshop migration sets it on the tables that the reverse translator reads. See PostgreSQL Connector.

  • One database user per connector, with only the documented privileges

C##DBZUSER for the Oracle source, bookshop_mirror for the mirror sink, BOOKSHOP_SYNC for the reverse writer. Separate users make the audit trail readable, allow revoking one pipeline, and are the basis of loop prevention by user. See Security & Data Protection.

  • The signal table BOOKSHOP.DEBEZIUM_SIGNAL exists, has all-column supplemental logging, C##DBZUSER has INSERT and DELETE on it, and a log signal works

Incremental snapshots, ad hoc re-reads and pausing a snapshot all depend on it. Without the INSERT and DELETE grants, which the official grant list does not include, incremental snapshots fail with ORA-41900 when the connector writes its watermarks. Use the PDB form FREEPDB1.BOOKSHOP.DEBEZIUM_SIGNAL in signal.data.collection: the CDB form that the property description suggests is silently ignored. Insert a log signal after the first registration and check the connector log. See Signaling & Notifications.

  • A DDL procedure is agreed with the legacy team

Every schema change on a captured table must be known before it runs, applied in an order that the connector and the consumers survive, and followed by a reconciliation that includes the new column. See Handling Schema Changes.

The connector

Item Rationale
  • One source connector per legacy database

Each Oracle connector runs one LogMiner session, and each PostgreSQL connector holds one slot. A second connector doubles the load on the legacy database and the operational state. Add tables to the existing connector, with an incremental snapshot, instead. See Incremental & Blocking Snapshots.

  • topic.prefix is short, stable and names the origin (legacy, modern), and it never changes

The prefix is part of every topic name and of the offset key. Changing it creates a new connector that starts with a new snapshot, and the old topics stop receiving changes. See Debezium Architecture.

  • Heartbeats are on: heartbeat.interval.ms plus heartbeat.action.query against a captured heartbeat table

In CDB mode a quiet FREEPDB1 produces nothing that advances the offset, and a quiet PostgreSQL database keeps WAL behind its slot. The action query creates a real change every interval. It also makes "no event for two minutes" a meaningful alert. See Oracle Connector and PostgreSQL Connector.

  • Oracle: log.mining.strategy=hybrid, and a log.mining.query.filter.mode that matches the include lists

redo_log_catalog is deprecated, and hybrid resolves rows written before a DDL change without writing the data dictionary to the redo logs. The in filter mode needs plain table names, not regular expressions. See Oracle Connector.

  • Oracle: log.mining.transaction.retention.ms and log.mining.buffer.transaction.events.threshold stay at 0

Non-zero values let the connector abandon long-running transactions, and an abandoned transaction is data missing on the target. Use them only when data loss followed by reconciliation is an accepted trade-off.

  • The schema history topic legacy.schema-history has one partition and infinite retention, and nothing else reads or writes it

The connector rebuilds its schema model from this topic at every start. A compacted, multi-partition or truncated history makes the next restart fail or, worse, decode rows with the wrong structure. See The schema history topic.

  • Topic creation rules are explicit: partitions, replication factor, retention or compaction per group of topics

Without a default topic creation group, Kafka Connect does not create the topics, or the broker defaults apply. Compacted catalogue topics let a new consumer rebuild state without a new snapshot. See Installing Debezium.

  • No password in a connector configuration: configuration providers resolve the secrets

Connector configurations are stored in plain text in the config topic and returned by the REST API. See Keeping secrets out of connector configurations.

  • Monitoring and alerts are live before the first production snapshot (see Operations)

The first snapshot is when the pipeline is most likely to fail, and its metrics are the evidence for the exit criterion of the snapshot-and-streaming phase.

A baseline for the Bookshop Oracle source

The configuration below combines the connector of the Oracle Connector page with the settings that the JDBC mirror sink and the Spring Boot anti-corruption layer of Listening to Events in Applications depend on: JSON with embedded schemas, decimals as strings and transaction metadata. The password comes from the environment through a configuration provider, which must be enabled on the worker.

bookshop-oracle-source.json — recommended baseline
{
  "name": "bookshop-oracle-source",
  "config": {
    "connector.class": "io.debezium.connector.oracle.OracleConnector",
    "tasks.max": "1",

    "database.hostname": "oracle",
    "database.port": "1521",
    "database.user": "c##dbzuser",
    "database.password": "${env:BOOKSHOP_ORACLE_PASSWORD}",
    "database.dbname": "FREE",
    "database.pdb.name": "FREEPDB1",
    "topic.prefix": "legacy",

    "database.connection.adapter": "logminer",
    "log.mining.strategy": "hybrid",
    "log.mining.query.filter.mode": "in",
    "lob.enabled": "false",

    "table.include.list": "BOOKSHOP.BOOK,BOOKSHOP.AUTHOR,BOOKSHOP.CUSTOMER,BOOKSHOP.ORDERS,BOOKSHOP.ORDER_LINE,BOOKSHOP.SUPPLIER_CATALOGUE,BOOKSHOP.DEBEZIUM_HEARTBEAT",

    "snapshot.mode": "initial",
    "snapshot.locking.mode": "shared",
    "include.schema.changes": "true",
    "schema.history.internal.kafka.bootstrap.servers": "kafka:9092",
    "schema.history.internal.kafka.topic": "legacy.schema-history",
    "schema.history.internal.store.only.captured.tables.ddl": "false",

    "key.converter": "org.apache.kafka.connect.json.JsonConverter",
    "key.converter.schemas.enable": "true",
    "value.converter": "org.apache.kafka.connect.json.JsonConverter",
    "value.converter.schemas.enable": "true",
    "decimal.handling.mode": "string",
    "provide.transaction.metadata": "true",
    "tombstones.on.delete": "true",

    "signal.enabled.channels": "source,kafka",
    "signal.data.collection": "FREEPDB1.BOOKSHOP.DEBEZIUM_SIGNAL",
    "signal.kafka.topic": "legacy.signals",
    "signal.kafka.bootstrap.servers": "kafka:9092",
    "notification.enabled.channels": "sink,log",
    "notification.sink.topic.name": "legacy.notifications",

    "heartbeat.interval.ms": "10000",
    "heartbeat.action.query": "UPDATE BOOKSHOP.DEBEZIUM_HEARTBEAT SET LAST_BEAT = SYSTIMESTAMP WHERE ID = 1",

    "topic.creation.default.replication.factor": "3",
    "topic.creation.default.partitions": "1",
    "topic.creation.default.cleanup.policy": "delete",
    "topic.creation.default.retention.ms": "1209600000"
  }
}

Why these values:

  • Connection and mining are those of the Oracle page: the CDB FREE as database.dbname, the PDB FREEPDB1, the default logminer adapter with the hybrid strategy, and LOB capture off (Bookshop has no LOB columns, and hybrid requires lob.enabled=false).

  • schema.history.internal.store.only.captured.tables.ddl=false is the default. It is written down because the cut-over relies on it: the history keeps tracking BOOK and AUTHOR after they are removed from the include list, so a rollback can add them back without a recovery snapshot.

  • JSON with schemas enabled is what the JDBC mirror sink needs: with schemas disabled it skips every record because it does not recognise a Debezium record. The anti-corruption layer unwraps the payload. The messages are larger; Avro with Apicurio Registry is the alternative when volume matters, as described in Serialization & Schema Registries. Whatever you choose, every consumer of a topic must read the same format.

  • decimal.handling.mode=string turns every Oracle NUMBER into a string, including integer keys such as "BOOK_ID":"7". The consumer converts prices to BigDecimal without loss, and the mirror sink needs ?stringtype=unspecified at the end of its JDBC URL so that PostgreSQL casts the strings to bigint and numeric.

  • provide.transaction.metadata=true and tombstones.on.delete=true give the consumer its idempotency key (the transaction id and the position in the transaction) and give compaction its delete markers. See Transaction metadata.

  • Signals, notifications and heartbeats are needed by incremental snapshots, runbooks that wait for the snapshot, and the "no events" alert. signal.data.collection uses the PDB form, and the signal table does not have to be in table.include.list.

  • Topic creation gives every table topic one partition, as the official topic recommendations suggest, three replicas and two weeks of retention. Add a compacted group for the catalogue topics if new consumers should be able to rebuild the catalogue from Kafka (see Installing Debezium).

Not in the baseline, but added at a defined moment:

  • log.mining.username.exclude.list=BOOKSHOP_SYNC before the reverse sink starts writing to Oracle (cut-over phase).

  • exactly.once.support=required, once every Connect worker has exactly.once.source.support=enabled (operations phase). See Offsets, Restarts & Exactly-Once.

  • custom.metric.tags, together with a matching JMX exporter rule (see Monitoring, Logging & Tracing).

Validate the configuration before registering it. Kafka Connect checks property names and values without starting the connector:

Validating the baseline before registration
jq '.config' bookshop-oracle-source.json \
  | curl -s -X PUT -H "Content-Type: application/json" --data @- \
      http://localhost:8083/connector-plugins/OracleConnector/config/validate \
  | jq '.error_count, [.configs[] | select(.value.errors | length > 0) | .value | {name, errors}]'

An error_count of 0 means the configuration is valid. Database problems (missing grants, a closed PDB, NOARCHIVELOG) appear only when the task starts.

Initial load

Item Rationale
  • The snapshot mode is chosen per connector: initial for the legacy source, no_data for the reverse source

The reverse connector must not snapshot rows that came from Oracle in the first place, or every row is written back to Oracle a second time. schema_only and schema_only_recovery are deprecated; use no_data and recovery. See Initial Snapshots.

  • The snapshot was rehearsed with initial_only against a production clone, and its duration is known

SnapshotDurationInSeconds and RowsScanned from the rehearsal size the undo retention, the archive log retention, the Kafka disk and the sink scaling.

  • Oracle UNDO_RETENTION covers the longest table snapshot

The snapshot reads each table with a flashback query at one SCN. A snapshot that outlives the undo fails with ORA-01555: snapshot too old.

  • Very large tables use no_data plus incremental snapshots

An initial snapshot is not resumable: a failure at 90 % starts again from zero, and streaming cannot begin until it ends. Incremental snapshots run in chunks, interleave with streaming, and can be paused around the legacy batch window. See Incremental & Blocking Snapshots.

  • Runbooks wait for the snapshot-completed notification, not for the RUNNING status

A connector in the snapshot phase and one in the streaming phase both report RUNNING. The notifications on legacy.notifications say when each table is done. See Signaling & Notifications.

  • The sinks and consumers are scaled for the burst, and the mirror tables' secondary indexes are added after the load

The whole table arrives as r events in a short time. A sink that cannot keep up only delays the phase, but a consumer that times out and rebalances repeatedly can stall it.

  • No DDL runs on a table while its incremental snapshot is in progress

The Oracle connector does not support schema changes during an incremental snapshot.

  • Row counts per table match after the snapshot

The exit criterion of the snapshot-and-streaming phase. Compare COUNT(*) on the legacy tables with the mirror and new tables before streaming is trusted. See Verification & Reconciliation.

Streaming

Item Rationale
  • Alerts exist on the age of the oldest open transaction (OldestScnAgeInMilliseconds)

A legacy transaction that stays open pins the offset SCN. Its changes cannot be emitted before the commit, and the archive logs from its start must be kept. See Monitoring, Logging & Tracing.

  • AbandonedTransactionCount and NumberOfErroneousEvents stay at zero

Both mean that changes did not reach Kafka. For a migration, any non-zero value is missing data on the target.

  • event.processing.failure.handling.mode stays at fail

warn and skip keep the connector running by dropping the event that failed. A stopped connector is visible; a skipped change is found only by reconciliation, if at all.

  • Legacy DDL follows expand/contract, and the schema change topic legacy is watched for unplanned DDL

Adding a nullable column first, then using it, then removing the old one keeps the connector, the sink and the consumers working at every step. See Handling Schema Changes and Evolving the Database Model: best practices.

  • With Avro, the registry’s compatibility rules are set for the change topics

The registry is the only point in the pipeline that can reject a breaking schema change automatically. See Serialization & Schema Registries.

  • Truncates stay skipped (the default skipped.operations=t), unless every consumer handles them

A legacy TRUNCATE during the migration needs a human decision. Emitting it lets a sink with truncate.enabled=true empty a mirror table.

  • PostgreSQL sources: an alert on retained WAL per slot

A slot that does not advance keeps WAL until the disk fills. Heartbeats fix the common causes. See PostgreSQL Connector.

Consumers and sinks

Item Rationale
  • Every sink and consumer is idempotent

Debezium delivers at least once. After a connector restart, changes since the last committed offset are re-emitted at new Kafka offsets. See Features & Delivery Guarantees.

  • JDBC sinks use insert.mode=upsert with primary.key.mode=record_key

Writing the same row twice gives the same result, and the key comes from the event key, so primary.key.fields is not needed. See JDBC Sink Connector.

  • The PostgreSQL sink URL ends in ?stringtype=unspecified when decimals are sent as strings

Without it the driver sends the string values as varchar, and PostgreSQL rejects them with "column is of type bigint but expression is of type character varying".

  • Hand-written consumers record the source position in processed_change, in the same transaction as their writes

Upserts alone let an old replayed event overwrite newer values for a moment, and some writes are not naturally idempotent. The source position (not the Kafka offset) identifies a change across restarts. See Listening to Events in Applications.

  • Deletes are applied: delete.enabled=true on the sinks, the d event (not the tombstone) in consumers

Without it, rows deleted in the legacy database stay in the target and appear as drift in every reconciliation. A tombstone carries no before state and can be disabled, so it is not a delete signal.

  • Ordering per key is kept: blocking retries, no thread pool in the listener, no re-keying, concurrency at most the partition count

Kafka orders events only within a partition. A retry topic or a re-keying transformation lets a newer change of the same row overtake an older one.

  • Failed records go to a monitored dead-letter topic, and the sink stops (errors.tolerance=none) until one is configured

A record in a dead-letter topic is a change the new database does not have. The JDBC sink sends failed writes to the DLQ only with internal.enable.sces=true. See JDBC Sink Connector.

  • Model translation lives in the application (the anti-corruption layer), not in SMTs

SMTs are stateless per record. They cannot join ORDERS with ORDER_LINE, look up reference data or carry versioned business rules. Keep SMTs for routing, filtering and flattening. See Debezium Transformations and The anti-corruption layer.

  • Consumers ignore unknown source fields and the heartbeat topics

A new Debezium release adds fields to source. The __debezium-heartbeat.legacy topic and the legacy.BOOKSHOP.DEBEZIUM_HEARTBEAT table topic carry no business data.

  • Consumers never write __debezium_unavailable_value into the target

The placeholder appears for LOB and TOAST columns that the log did not carry. See Data Types & Precision.

  • Exactly-once is treated as an optimisation, not as a replacement for idempotency

Kafka Connect exactly-once covers only the hop from the database to Kafka. The write to PostgreSQL and the Kafka offset commit of the consumer are still two steps. See Offsets, Restarts & Exactly-Once.

Verification

Item Rationale
  • Reconciliation compares per-chunk checksums at a known SCN, not just row counts

Counts miss wrong values. A canonical row format hashed on both sides finds them, and comparing at the SCN that the pipeline has reached avoids false alarms from changes still in flight. See Verification & Reconciliation.

  • Reconciliation runs with read-only users and is clean for a full business cycle

Month-end, batch runs and seasonal peaks exercise code paths and data that a quiet week does not. This is the exit criterion of the parallel run.

  • Shadow reads compare the new read path with the legacy one behind a feature flag

A clean data comparison does not prove that the new application answers the same questions the same way. See Feature flags and cohort-based cut-over.

  • End-to-end lag is measured from source.ts_ms at the consumer, not only from MilliSecondsBehindSource

The connector metric covers only the source. The sink and the application add their own lag, and the cut-over decision needs the sum.

  • Drift is repaired with ad hoc incremental snapshots limited by additional-conditions, and every repair is documented

Re-reading a key range through the signal table repairs the target without stopping streaming or reloading the whole table. See Incremental & Blocking Snapshots.

  • A reconciliation runs after every incident

A pipeline that is green again is not proof that the data is right, for example after a lost log position or a reset. See Troubleshooting & Failure Recovery.

Cut-over

Item Rationale
  • Reads are cut over before writes, cohort by cohort, behind the strangler proxy

A read cut-over is rolled back instantly by routing reads back. It also proves the new application under production load while the legacy database is still the source of truth. See Cut-over & Reverse Replication.

  • The write cut-over and its rollback were rehearsed on staging with production-like data

Reverse replication that has never run fails when it is needed. The rehearsal also measures the length of the write freeze, which is mostly the final reconciliation.

  • The reverse pipeline (bookshop-pg-source, bookshop-oracle-reverse-sink) is registered in advance, in the STOPPED state

Registration problems are found before the freeze, not during it.

  • The write cut-over follows the order: freeze, drain, final reconciliation, reconfigure forward capture, write guard, start reverse, route writes, lift the freeze, smoke test

Draining before reconciling makes the comparison exact; reconfiguring forward capture before reverse starts keeps loops out of the pipeline.

  • One direction per table: moved tables are removed from the forward table.include.list, and BOOKSHOP_SYNC is excluded with log.mining.username.exclude.list

A table captured in both directions echoes every change between the databases. Excluding the reverse writer is the second, independent cut.

  • The reverse replication slot bookshop_reverse is created at the cut-over moment

Every write after slot creation is retained, even if the connector starts minutes later. With snapshot.mode=no_data the connector streams from the slot position. See PostgreSQL Connector.

  • Loop prevention in the reverse direction is tested (replication origin or origin marker column)

The smoke test must show that no change written by the reverse writer was captured again on either side.

  • The point of no return is a recorded decision, and features that cross it are held back until then

The first book with two authors, or a new order status, cannot be written back into the legacy model. After that moment a rollback loses data, so it must be chosen, not discovered.

  • A stopped reverse connector after a rollback is either resumed within hours or its slot is dropped

A forgotten slot keeps WAL on the new production database until its disk is full.

Operations

Item Rationale
  • Alerts on: task FAILED, task absent, Connected=0, streaming lag, no events, queue saturation, long transactions, abandoned transactions, erroneous events, retained WAL, consumer lag and dead-letter topic size

These are the failures that break a migration silently. Alert on the absence of task metrics too, because a stopped or deleted connector has none. See Monitoring, Logging & Tracing.

  • Database-side checks: the oldest available archive log stays below the connector’s OffsetScn

The connector cannot see that the DBA’s backup job is about to delete the log it needs next.

  • Each failure mode has a written runbook: lost log position, lost schema history, invalid resume token, failover, large transactions

Recovery under pressure goes wrong when the steps are improvised. See Troubleshooting & Failure Recovery.

  • Offsets are saved before any reset (GET .../offsets), and resets are done on a STOPPED connector

The saved file is the only way back. Resetting a running or paused connector has unpredictable results. See Offsets, Restarts & Exactly-Once.

  • Debezium upgrades are rehearsed and the release notes are read for renamed properties

topic.prefix replaced database.server.name, schema.history.internal.* replaced database.history.*, and 3.7 removed continuous mining and the Cassandra 3 connector. A renamed property is silently ignored.

  • Planned outages of the pipeline are shorter than the log retention, and maintenance stops use STOPPED

On Kubernetes, spec.state: stopped on the KafkaConnector keeps the offsets. See Running on Kubernetes.

  • Credentials are rotated through the configuration provider, followed by a connector restart

The provider resolves the value when the task starts.

  • The Connect REST API is reachable only from the private network and from automation

Anyone who can call it can read configurations, reset offsets or register a connector that reads any file the worker can see. See Security & Data Protection.

  • Connector logs contain no record contents

Logged values end up in log storage with its own retention and access rules.

Decommissioning

Item Rationale
  • The exit criterion of the write cut-over is met: no legacy reader or writer depends on the copied tables

Decommissioning is the only phase that is not reversible, except from an archive. See Migration Path: From a Legacy Stack to a Modern One.

  • Connectors are stopped, their offsets deleted, then the connectors deleted

A connector re-registered by accident months later under the same name resumes from an old position if its offsets are still stored. See Cut-over & Reverse Replication.

  • The PostgreSQL slot bookshop_reverse, the publication bookshop_reverse_pub and any replication origin are dropped

An inactive slot keeps WAL forever.

  • Oracle: the signal table and the reverse-writer user are dropped, table-level supplemental logging is removed, and, after the last capability, C##DBZUSER and database-level supplemental logging (if nothing else uses it)

Leftover users are an attack surface, and supplemental logging increases redo volume for no benefit.

  • Topics are archived according to the retention policy, then deleted, together with the consumer groups

The change topics are the audit trail of what moved and when. Archive legacy.*, modern.*, the schema history, signal, notification and heartbeat topics and the dead-letter topics before deleting them.

  • The mirror tables, the migration code and its configuration are removed from the new application

Unused translators and legacy_* tables confuse future maintainers and keep dead dependencies alive.

Capacity planning

Measure first, on the production clone, then size. The questions below cover the resources that a migration exhausts.

Resource Question Where it is explained

Oracle archive logs

How much redo does the legacy workload produce per hour, and how many hours of outage must the retention cover?

Oracle Connector

Oracle undo

Does UNDO_RETENTION cover the longest table snapshot?

Initial Snapshots

PostgreSQL WAL

How much WAL can a stopped or lagging slot retain before the disk is full, and what does max_slot_wal_keep_size do?

PostgreSQL Connector

Kafka disk

Snapshot size (rows times event size, which is larger than the row) plus the streaming backlog for the retention period, times the replication factor?

Initial Snapshots

Connector throughput

Does one task per Oracle connector keep up at peak? Watch QueueRemainingCapacity and tune max.batch.size (default 2048) and max.queue.size (default 8192) in small steps.

Monitoring, Logging & Tracing

Sink and consumer throughput

Does the slowest of the mirror sink and the bookshop-legacy-sync group keep the end-to-end lag within its objective at peak, and how long does it take to catch up after an outage?

JDBC Sink Connector, Listening to Events in Applications

Partitions

One partition per table topic keeps the global order of the table; more partitions add parallelism but keep the order only per key. Do the consumers need more than one?

Installing Debezium

Common anti-patterns

Anti-pattern Why it hurts Do this instead

Writing to both databases "just during the cut-over"

Loops and conflicting updates that no pipeline can resolve

One source of truth per table, a short write freeze, reverse CDC

A shared "debezium" user with DBA rights

No audit trail per pipeline, no loop prevention by user, one revocation stops everything

One least-privilege user per connector

Changing topic.prefix on a running connector

A new connector with a new snapshot; the old topics go silent

Choose the prefix once; a new prefix is a new pipeline

No heartbeats on a quiet database

Offsets stop advancing, WAL or archive logs pile up, alerts on "no events" are useless

heartbeat.interval.ms plus heartbeat.action.query

Trusting RUNNING as "snapshot done"

Sinks and reconciliation start against half-loaded topics

Wait for the snapshot-completed notification

Using tombstones as delete signals

Tombstones can be disabled and carry no before state

Act on the d event; ignore tombstones

Upserts without a replay guard in hand-written consumers

Old values come back for a moment after a connector restart

processed_change keyed by the source position

Translating the model in SMTs

Untestable logic in connector JSON, no joins, no reference data

An anti-corruption layer in the application

Non-zero log.mining.transaction.retention.ms "to save memory"

Long transactions are abandoned and their changes never reach the target

Leave it at 0; alert on OldestScnAgeInMilliseconds

event.processing.failure.handling.mode=skip to keep the pipeline green

Changes disappear without a trace

fail, then fix the cause

Reconciling with row counts only

Wrong values go unnoticed until users find them

Per-chunk checksums at a known SCN

Cutting over writes without a rehearsed rollback

The reverse pipeline fails the first time it is needed

Rehearse cut-over and rollback on staging

Forgetting a stopped connector’s slot or log position

A pipeline outage becomes a full disk on a production database

Alerts on retained WAL and archive logs; drop slots when a connector is retired

Crossing the point of no return by accident

A rollback silently loses data the legacy model cannot hold

Hold back such features until a recorded decision