Lakeflow Connect – Migration from Query-Based Ingestion to Log-Based CDC

faruk
Contributor III

Hi all,

I'm currently using the Query-Based Connector in Lakeflow Connect to ingest tables from an Oracle database into Databricks.

We are now considering moving to the Log-Based CDC Connector when it reaches Public Availability to benefit from native change data capture rather than relying on query-based incremental ingestion.

I've recently been looking into Log-Based CDC with Lakeflow Connect. However, it requires some changes on the Oracle database side, particularly regarding the redo log configuration and supplemental logging. One of our teams is currently working on these database changes.

Before moving forward, I'd like to clarify one important aspect regarding the migration path.

My questions are:

  1. If we have already ingested tables using the Query-Based Connector, will it be possible to migrate those existing tables to the Log-Based CDC Connector without performing a full initial load again?

  2. Does Databricks provide a migration mechanism to transition from Query-Based ingestion to Log-Based CDC while preserving the existing data and ingestion state?

I'd appreciate hearing from anyone who has already implemented or tested this migration scenario.

Thanks in advance for your feedback!

arthurfr23
Contributor III

Reading the doc, I don't believe this will be posible. The docs don't describe any way to move query-based tables or their ingestion state into a log-based CDC pipeline. Plan for a new initial load.

Why:

  • The state isn't compatible. The query-based connector only stores a cursor high-water mark per table. CDC tracks its position in Oracle's redo/archive logs (LogMiner). A cursor value can't be turned into a log position, so CDC has nothing to resume from.
  • You can't switch the existing pipeline. The Oracle integrated CDC pipeline docs say connection and connector type can't be changed after the pipeline is created. They also say the first update takes a full snapshot of all selected tables, and large tables may need several updates to finish it.
  • You can't reuse the target tables. Per the Oracle CDC limitations, the update fails if a source table name conflicts with an existing destination table name.

What I'd do:

  1. Create the CDC pipeline with a new destination schema, alongside the query-based one.
  2. Let the snapshot finish and confirm it's applying changes, then compare row counts and checksums against the old tables.
  3. Switch downstream consumers (views or a swap), then retire the query-based pipeline.

Check the schema before you switch. The Oracle CDC FAQ says DATE lands as TIMESTAMP and plain TIMESTAMP lands as string, so the new tables may not match the old ones type for type. Also make sure archive logs are kept long enough to cover the snapshot plus your schedule interval. If they're purged before the pipeline runs, the pipeline can't resume and the tables need a full refresh.

Arthur Ferreira Reis

View solution in original post