- Starter
- Business
- Enterprise
- On-Premise
- Add-on
Overview
Change Data Capture (CDC) pipeline allows extracting changes in real-time from the databases which support CDC and loading them into the Snowflake.
Etlworks includes a built-in, deeply integrated CDC engine based on a customized version of Debezium.
There is nothing to install or manage separately—the CDC engine runs as part of the flow execution.
Supported source databases
- MySQL
- SQL Server
- PostgreSQL
- Oracle
- DB2
- MongoDB
- AS400 (IBMI platfroms)
When to use this pipeline
Use the pipeline described in this article to extract data from the CDC-enabled database and load it into Snowflake in real time.
Flows optimized for Snowflake
| Flow type | When to use | |
|
When you need to extract data from any source, transform it and load it into Snowflake. | |
| Bulk load files into Snowflake | When you need to bulk-load files that already exist in the external Snowflake stage (S3, Azure Blob, GC blob) or in the server storage without applying any transformations. The flow automatically generates the COPY INTO command and MERGEs data into the destination. | |
| Stream CDC events into Snowflake | You are here | When you need to stream updates from the database which supports Change Data Capture (CDC) into Snowflake in real time. |
| Stream messages from a queue into Snowflake | When you need to stream messages from the message queue which supports streaming into Snowflake in real time. | |
| COPY files into Snowflake | When you need to bulk-load data from the file-based or cloud storage, API, or NoSQL database into Snowflake without applying any transformations. This flow requires providing the user-defined COPY INTO command. Unlike Bulk load files into Snowflake, this flow does not support automatic MERGE. |
How it works
A CDC pipeline into Snowflake captures real-time changes from a CDC-enabled source database, stages them in Snowflake or cloud storage, and loads them using Snowflake’s native ingestion mechanisms.
You can build the pipeline using two options, depending on your reliability, performance, and scaling needs:
Option 1: Single Flow – Stream and Load Together
Use this option for simplicity and quick setup.
-
A single flow streams CDC events into a Snowflake or cloud stage and periodically loads them into target tables using native Snowflake bulk load (as frequently as every second).
-
Only one flow to configure, schedule, and monitor.
-
The flow is fully fault-tolerant: if streaming or loading fails, the entire process resumes from the last successful checkpoint once the issue is resolved.
-
Best for: low to moderate data volumes and teams prioritizing simplicity.
-
Consideration: Since streaming and loading are tightly coupled, a failure in one pauses both.
Option 2: Separate Extract and Load Flows
Use this option for maximum throughput, fault isolation, and horizontal scaling.
-
Build two independent flows:
-
Extract Flow: streams CDC events into the Snowflake or cloud stage.
-
Load Flow: loads staged data into Snowflake using native bulk operations.
-
-
The flows run in parallel and can be deployed across multiple nodes for large-scale workloads.
-
Best for: high-volume, low-latency pipelines and mission-critical systems where stability and performance are essential.
Prerequisites
1. Enable CDC in the source database:
- Enable CDC for Microsoft SQL Server
- Enable CDC MySQL
- Enable CDC for Oracle
- Enable CDC for PostgreSQL
- Enable CDC for DB2
- Enable CDC for MongoDB
- Enable CDC for AS400 (IBMI platfroms)
2. The Snowflake data warehouse is active.
3. The Stage name is set for the Snowflake connection or Transformation (the latter overrides the stage set for the Connection). Etlworks uses the SnowflakeCOPY INTOcommand to load data into Snowflake tables.COPY INTOrequires a named internal or external stage. Stage refers to the location where your data files are stored for loading into Snowflake. Read how Etlworks flow automatically creates the named Snowflake stage.
4. For loading data from the external stage in AWS S3, Azure Blob, or Google Cloud Storage, the Amazon S3 bucket, Google Storage bucket, or Azure blob needs to be created. Note that Etlworks flow does not create the bucket or blob.
A pipeline with a single flow
Create and schedule Snowflake CDC flow
Snowflake CDC flow streams CDC events into the designated Snowflake stage in real-time and periodically (as often as every second) loads the data into Snowflake in parallel with the stream.
Note: There is no need to create a separate Flow for the initial load. The first time it connects to a CDC-enabled source database, it reads a consistent snapshot of all of the included databases and tables. When that snapshot is complete, the Flow continuously reads the changes that were committed to the transaction log and generates the corresponding insert, update, and delete events.
Read more about CDC in Etlworks.
Step 1. Create a CDC Connection for the source.
Read how to create a CDC connection.
Step 2 (optional). Create connection for staging files in a cloud storage
If you are planning to use an external Snowflake stage in AWS S3, Azure Storage, or Google Cloud Storage you need to create one of the following connections:
- Amazon S3 - for staging files in S3.
- Google Cloud Storage - for staging files in GC storage.
- Microsoft Azure Storage - for staging files in Azure Blob.
This step is not required if you are using internal Snowflake stage.
Step 3. Create a Snowflake connection for the destination.
Important: When creating a Connection, set the Stage name. For loading files in cloud storage, the named external stage must be configured to read data from the storage type and location configured for the CDC connection. You can override the stage name set for the Connection when configuring the CDC source-to-destination transformation. Read how Etlworks flow automatically creates the named Snowflake stage.
Step 4. Create a connection for history and offset files.
Read how to create CDC Offset and History connection.
Etlworks CDC connectors store the history of DDL changes for the monitored database in the history file and the current position in the transaction log in the offset file.
Typical CDC extract flow starts by snapshotting the monitored tables (A) or starts from the oldest known position in the transaction (redo) log (B), then proceeds to stream changes in the source database (C). If the Flow is stopped and restarted, it resumes from the last recorded position in the transaction log. The connection created in this step can be used to reset the CDC pipeline and restart the process from scratch.
The connection, by default, points to the directory {app.data}/debezium_data.
Step 5. Create Snowflake CDC flow.
In Flows click Add flow. Type incdc in Select Flow type. Select Stream CDC events into Snowflake.
Step 6. Add source-to-destination transformation
Left to right:
- select the CDC connection
- select tables to monitor in FROM
- select the Snowflake connection created
- select or enter the Snowflake table name in TO. When streaming data from multiple source tables set the destination table using a wildcard template in the following format:SCHEMA.PREFIX_*_SUFFIX, whereSCHEMAis a Snowflake schema to load data into. You can use a fully qualified table name:DATABASE.SCHEMA.*.
Step 7 (optional). Set connection for staging files in the cloud storage.
If you are planning to use an external Snowflake stage in AWS S3, Azure Storage, or Google Cloud select Connections tab, select connection created in step 2 and select CSV format.
This step is not required if you are using internal Snowflake stage.
Step 7. Configure load parameters
Click the MAPPING button, select the Parameters tab.
If needed modify the following Load parameters:
- Load data into Snowflake every (ms): by default, the flow loads data into Snowflake every 5 minutes (300000 milliseconds). The load runs in parallel with the CDC stream, which never stops. Decrease this parameter to load data into Snowflake more often or increase it to reduce the number of consumed Snowflake credits.
- Wait (ms) to let running load finish when CDC stream stops: By default, the flow loads data into Snowflake every 5 minutes. The CDC stream and load are running in parallel, so when streaming stops, the flow executes the load last more time to finish loading the remaining data in the queue. It is possible that the load flow is still running when the stream stops. Use this parameter to configure how long the flow should wait before executing the load last time. Clear this parameter to disable the wait. In this case, if the load task is still running, the flow will finish without executing the load one last time. The flow will load the remaining data in the queue on the next run.
- Action: the action can be MERGE (default) or INSERT. If the action is set to MERGE the flow will INSERT records that do not exist in the destination table, UPDATE existing records, and DELETE records that were deleted in the source table.
- Lookup Fields: MERGEaction requires a list of columns that uniquely identify the record. By default, the flow will attempt to predict the Lookup Fields by checking unique indexes in the source and destination tables, but if there is no unique index in either table it is not guaranteed that the prediction will be 100% accurate. Use this parameter to define the Lookup Fields in the following format: fully.qualified.table1=field1,field2;fully.qualified.table2=field1,field2.
Note: The other parameters are similar or the same as for the flow type Bulk load files into Snowflake.
Step 8. Schedule Snowflake CDC flow.
We recommend using a continuous run Schedule type. The idea is that the Flow runs until it is stopped manually, there is an error, or (if configured) there are no more new CDC events for an extended period of time. It restarts automatically after a configurable number of seconds.
Monitor running CDC flow
Read how to monitor running CDC flow.
A pipeline with independent extract and load flows
CDC extract flow extracts data from a CDC-enabled database and creates CSV files with CDC events in the configured location. These files are loaded into the target database by Load Flow.
Step-by-Step Guide
Step 1. Create and schedule CDC Extract flow
This flow is used to extract CDC events from the source database in read time and create files with events.
Read how to create CDC extract flow.
Step 2. Create and schedule Bulk Load flow
This Flow is used to bulk load files created by the CDC extract flow into Snowflake.
Read how to create bulk load flow.
Step 3. Schedule Bulk Load Flow.
Schedule flow to run as often as needed. These are the options:
- Run flow periodically (as often as once a minute)
- Run flow continuously (as often as once a second).