Choosing a Deployment for Your Migration
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
The pages of this section explain each Debezium building block in depth. This page puts them together as decisions. A migration has to answer five questions before the first connector is registered:
-
Which runtime hosts the connectors: Kafka Connect, Debezium Server or the Debezium Engine?
-
How do changes reach the new database: a sink connector that copies rows, or application code that translates them?
-
Which snapshot strategy loads the existing data, given its size and what the legacy database allows?
-
Is the synchronisation one-way or two-way, and for how long?
-
Where does it all run: on a laptop, on Kubernetes, or on managed cloud services?
Each answer depends partly on the previous ones, so the flowchart below walks through them in order. The tables after
it give the criteria for each choice and link every row to the page that covers it. The Bookshop migration (legacy
Oracle schema BOOKSHOP to the Spring Boot bookshop application on PostgreSQL 18) is used as the running example,
and the last sections show how the same questions lead to different answers for smaller migrations.
Checked on 2026-11-09 against Debezium 3.7.1.Final. This page contains no runnable configuration; it summarises the pages it links, which state what was run on each of them.
The decision flow
The diagram is a simplification. A migration can combine runtimes (Kafka Connect for the main pipeline and an Engine inside a test harness), apply some tables with a sink and others with code, and use different snapshot strategies per table. The tables below explain the criteria behind each branch.
Decision 1: the runtime
All three runtimes run the same source connectors and produce the same change events. They differ in how many consumers can read the events, where offsets and the schema history live, and how failures are handled.
| If the migration… | Choose | Because | Details |
|---|---|---|---|
Runs for weeks or months, has several consumers (a mirror sink, an anti-corruption layer, reconciliation jobs, reverse replication) or needs to replay history |
Kafka Connect with Kafka |
Each consumer has its own position on durable topics; offsets and schema history are replicated in Kafka; workers rebalance tasks after a failure; exactly-once source delivery is available |
|
Moves data point to point into one target, or the organisation runs Kinesis, Pub/Sub, Event Hubs, Pulsar, NATS, RabbitMQ Streams or Redis instead of Kafka |
Debezium Server |
One process per source connector with a sink for that system, including a JDBC sink that writes straight into the new database; no Kafka cluster to run |
|
Is a tool or a service whose migration logic already lives in one Java application, or is an integration test |
Debezium Engine |
The connector runs in-process and calls your code for each batch; you own offsets, schema history and failure handling |
|
Must run on Kubernetes |
Kafka Connect with Strimzi, or Debezium Server with the Debezium Operator |
Both are declarative custom resources; the Debezium Management Platform adds a console and API for Debezium Server pipelines |
|
Must run on managed cloud services |
MSK Connect, Confluent Cloud (custom or fully managed connectors), self-managed Connect on EKS, GKE or AKS, or Debezium Server with a cloud sink |
The cloud database’s log settings and the managed runtime’s limits (plug-in packaging, capacity mode, Kafka Connect version) decide what is possible |
Two follow-up questions refine the choice:
-
Do you need exactly-once delivery from the source? Only Kafka Connect provides it (KIP-618, for the connectors that support it), and it is a worker setting. With Debezium Server or the Engine, design the consumers to be idempotent instead. See Offsets, Restarts & Exactly-Once.
-
Who operates it? Kafka Connect plus Kafka is the most capable option and the most infrastructure. If the team does not already run Kafka, the cost of learning and operating it is part of the migration’s cost. That is the strongest argument for Debezium Server in a small migration.
Decision 2: how changes reach the new database
A copy is not a migration. The question here is whether the new database has the same model as the legacy one.
| If the new database… | Apply changes with | Because | Details |
|---|---|---|---|
Has the same tables and columns (a re-platforming: same schema, new engine or new host) |
The Debezium JDBC sink connector, |
It consumes native Debezium envelopes, writes idempotently by primary key, applies deletes and can evolve the target schema |
|
Is a document database (MongoDB) holding one document per legacy row |
The Debezium MongoDB sink connector |
It upserts and deletes documents by the event key |
|
Has a new model (renamed columns, codes turned into enums, one table split into several, surrogate keys, |
An application consumer that acts as the anti-corruption layer (in Bookshop, |
Translation rules are business logic: they need tests, versioning and the new domain model, which SMTs cannot hold |
Listening to Events in Applications, Migration Patterns with CDC |
Has a new model, and the translation needs data from several legacy tables that change independently |
A mirror first (JDBC sink into |
The mirror gives the consumer a consistent, queryable copy of the related legacy rows, so it does not have to keep its own state for joins |
|
Needs only small, per-record changes (rename a topic or a field, drop a column, convert a time zone, flatten the envelope) |
Single message transformations on the sink or source connector |
Stateless per-record changes fit SMTs well; anything that needs state or several tables does not |
|
Should receive domain events rather than table rows (the new system is a set of services) |
An outbox table in the legacy application plus the Outbox Event Router |
Services consume intent-level events instead of the legacy schema, so they never couple to it |
Bookshop combines a sink and an application consumer on the same topics, in different consumer groups. The JDBC sink
bookshop-pg-mirror-sink keeps legacy_book, legacy_author and legacy_supplier_catalogue as 1:1 mirrors, which
the reconciliation compares with the new model, and the Spring Boot consumers translate the legacy events into
book, book_author, customer, purchase_order and order_line. The consumers read the events only, not the
mirror tables.
Decision 3: the snapshot strategy
The snapshot loads the rows that exist before streaming starts. The right strategy depends on how long a full read takes compared with how long the legacy database keeps its change log, on whether the read must be resumable, and on what the connector may do in the legacy database.
| Situation | Strategy | Why | Details |
|---|---|---|---|
The full data set can be read well within the log retention window, and a restart from zero is acceptable |
|
The simplest option: one consistent snapshot, then streaming from that position |
|
A table is so large that the snapshot could outlast the log retention, or restarting a failed multi-day snapshot from zero is unacceptable |
|
Streaming starts at once, so retention is no longer a race; incremental snapshots read in chunks, interleave with streaming and resume after a restart |
Initial Snapshots — Sizing a multi-terabyte snapshot, Incremental & Blocking Snapshots |
Only part of a large table is needed now (for example the last two years of |
Incremental snapshot with |
Loads a filtered range; the rest can follow later or never |
|
A table joins the migration scope while the connector is running |
Add it to |
The new table is backfilled without re-reading the others |
|
The connector may not write to the legacy database (no signal table allowed) |
A read-only incremental snapshot (PostgreSQL 13 or later, MySQL and MariaDB with GTIDs), triggered through the Kafka signal channel |
Watermarks come from the database’s own transaction state instead of signal table writes; the Oracle connector has no read-only variant, so it needs the signal table |
Incremental & Blocking Snapshots — Read-only incremental snapshots, Signaling & Notifications |
A table has no primary key |
An incremental snapshot with a |
Incremental chunks are ordered by a key; without one, a full read is the only option |
Incremental & Blocking Snapshots — Composite keys and the surrogate-key option |
A large table must be loaded quickly in a quiet window, and a pause in streaming is acceptable |
A blocking snapshot ( |
Faster than incremental, but streaming stops until it finishes and it is not resumable |
|
The data was already loaded by another tool (a dump, a bulk load), or the connector is the reverse-replication source on the new database |
|
Only changes from now on are needed; snapshotting reverse data would write every row back to the legacy database |
|
A rehearsal against a production clone, to measure how long the snapshot takes |
|
Snapshots and stops, so the duration and the Kafka volume can be measured before the real run |
|
The connector may be stopped for longer than the log retention, and consumers can absorb a full re-read |
|
Re-snapshots automatically when the stored position is gone instead of failing. It also hides the incident, so for a
migration source such as |
|
The schema history topic was lost or damaged |
|
Rebuilds the history from the current table structures; safe only if no DDL ran since the connector stopped |
Size is relative. A table is "large" when the time to read it, including the time Kafka and the sinks need to absorb
the burst, approaches the log retention you can afford on the legacy database. Measure it with an initial_only
rehearsal instead of guessing from row counts. The database-specific retention settings are on the connector pages and,
for managed databases, on Cloud Databases & Managed Kafka.
Decision 4: one-way or two-way synchronisation
Every CDC migration starts one-way: the legacy database is the source of truth and the new database follows. The question is what happens when writes move to the new system.
| Phase and requirement | Direction | What runs | Details |
|---|---|---|---|
Initial load, parallel run and read cut-over; the legacy system is the only writer |
One-way, legacy to new |
The source connector ( |
|
Write cut-over with no need to fall back: legacy consumers (reports, batch jobs) can be switched off or moved at the same moment |
One-way, then stop |
The forward pipeline is drained and stopped; the legacy database becomes read-only |
|
Write cut-over where the legacy system must stay correct for a while: as a rollback path, or because legacy reports and batch jobs still read it |
Two-way, with each table owned by one side at a time |
A reverse source on the new database ( |
|
Two-way sync is running |
Loop prevention is mandatory |
Each source connector skips the other direction’s writes. On Oracle, the forward connector sets
|
Oracle Connector — Filtering by user, Cut-over & Reverse Replication — Replication origins, Migration Patterns with CDC — Loops and ownership |
Both systems need to accept writes to the same rows at the same time |
Avoid |
CDC gives no conflict resolution; concurrent writes to one row on both sides lose updates. Split ownership by table, by entity or by customer cohort instead |
Two-way synchronisation doubles the moving parts and must have an end date. Decide before the cut-over what condition switches the reverse pipeline off; the decommission phase is described in Migration Patterns with CDC.
Decision 5: where it runs
| Environment | Typical shape | Details |
|---|---|---|
Laptop, tutorial or proof of concept |
Docker Compose with |
|
Integration tests in CI |
Testcontainers with the same images, or an embedded Debezium Engine |
|
Virtual machines or bare metal |
A Kafka Connect cluster with plug-in archives in |
|
Kubernetes |
Strimzi |
|
Managed cloud databases and managed Kafka |
RDS, Aurora, Cloud SQL, Azure Database or Azure SQL as source or target; MSK Connect, Confluent Cloud or Connect on EKS, GKE or AKS as the runtime |
Wherever it runs, a production migration also needs monitoring, secret handling and a recovery runbook before go-live: Monitoring, Logging & Tracing, Security & Data Protection and Troubleshooting & Failure Recovery.
The Bookshop choices
| Decision | Bookshop choice | Reason |
|---|---|---|
Runtime |
Kafka Connect with Kafka 4.x (KRaft), Connect REST at |
Several consumers (mirror sink, |
Wire format |
JSON with schemas enabled, |
The JDBC mirror sink needs the embedded schema, and every consumer of a topic must read the same format (see Best Practices) |
Applying changes |
|
The new model differs from the legacy one ( |
Snapshot |
|
The schema is small enough to snapshot within the archive log retention; incremental snapshots cover changes of scope |
Direction |
One-way during load, parallel run and read cut-over; two-way during the write cut-over, with |
Legacy reports keep reading Oracle until they are retired, and the rollback path must stay open |
Hosting |
Docker Compose for the worked example; Strimzi on Kubernetes for production |
The same connector JSON runs in both |
The full run is on Worked Example: Oracle to PostgreSQL.
Three smaller profiles
The same questions lead to simpler answers when the migration is simpler.
A same-schema move of a small MySQL database to PostgreSQL, one team, no Kafka. Several consumers? No. Destination?
One database. Debezium Server with its JDBC sink copies the tables directly, initial snapshot, one-way, then
decommission. The JDBC sink’s type mapping still has to be checked (see
Data Types & Precision).
A legacy PostgreSQL database feeding a new service that owns its own model, inside one Java application. The service can embed the Debezium Engine, translate events in-process and store offsets in its own database. This works while there is one consumer; the moment a second system needs the same events, move to Kafka Connect so that the events are on durable topics.
A large SQL Server database on Azure SQL, migrating to Azure Database for PostgreSQL, with an existing Kafka platform.
Kafka Connect on AKS, no_data plus incremental snapshots for the largest tables because the CDC change table retention
bounds how long a full read may take, the JDBC sink for same-shape tables and a consumer for the rest, and the
platform-specific settings from Cloud Databases & Managed Kafka.
Choices that cause trouble later
| Choice | Why it causes trouble |
|---|---|
Debezium Engine for a migration that later gains a second consumer |
Events are not on a durable, shared log; the second consumer needs a second capture (another slot or LogMiner session on the legacy database) or a re-architecture |
Doing the model translation in SMTs |
Stateless per-record transforms cannot join tables, look up reference data or keep versioned business rules; the logic ends up untested in connector JSON |
|
A snapshot that outlasts the retention cannot switch to streaming, and a failure restarts it from zero |
Two-way sync without loop prevention or ownership rules |
Changes echo between the databases, and concurrent writes to the same rows are lost |
Choosing a managed runtime before checking its limits |
Single-task connectors with autoscaling, missing JDBC drivers in uploaded plug-ins, or a Kafka Connect version that does not match the connector can block the migration late |
No decision on when two-way sync ends |
The reverse pipeline becomes permanent infrastructure with all the cost of the migration and none of the benefit |
The checklist on Best Practices turns these decisions into items to verify before go-live.