CDC
Capture inserts, updates, and deletes from an operational database in near real-time with Nilus CDC.
Change data capture (CDC) reads from a database's transaction log and delivers every insert, update, and delete to your engine in near real-time, without full reloads. Use it when freshness matters and reloading the whole table is too slow or too costly.
When to use CDC
The use case needs near real-time freshness.
Full reloads are too slow or expensive for the source.
You need to preserve the history of every change.
The source is a transactional database that exposes a transaction log or change stream.
If the source has no write-ahead log, binlog, oplog, or CDC tables, use batch instead.
Before you begin
CDC needs source-side setup before the pipeline can run:
PostgreSQL
wal_level = logical; a user with LOGIN, REPLICATION, SELECT, and CREATE (for publication auto-create); a publication; a primary key or REPLICA IDENTITY FULL. The slot is created on first start.
MySQL
log_bin on, binlog_format = ROW, binlog_row_image = FULL, a unique server_id; a user with SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT; primary keys on captured tables
MongoDB
A replica set or sharded cluster; a user with read on the target, local, and admin databases (and config.shards if sharded)
Microsoft SQL Server
CDC enabled on the database and target tables; SQL Server Agent running
IBM Db2
The ASN capture service running; each table added with ASNCDC.ADDTABLE, then a reinit; IIDR licensing; no BOOLEAN columns
You also need a Depot for the source (IBM Db2 has none; see below) and destination, and a compute profile. See supported CDC sources in References for full per-source prerequisites.
1. Write the manifest
Create a nilus resource with spec.type: cdc:
IBM Db2 has no Depot. Set source.address to a direct db2://{DB2_USERNAME}:{DB2_PASSWORD}@<host>:50000/<database> URI and project the credentials through spec.use.projection. See the IBM Db2 sample in References.
Choose the sink strategy:
append
Write every change as a new row. Preserves full change history. Not supported by the MongoDB destination.
merge
Upsert by primary key. The destination reflects current state.
For the full attribute reference, see CDC configuration in References.
2. Apply and confirm
When changes are landing, explore the moved data to confirm the destination reflects the source.
Last updated
Was this helpful?