Change data capture (CDC)
A Change Data Capture (CDC) stream continuously captures row-level inserts, updates, and deletes from your source database and streams them directly into your data pipelines.
Pair a CDC stream with a Merge load step to maintain an exact replica of your operational database without re-extracting entire tables on every schedule.
Manage CDC streams under Pipelines → CDC streams.
Supported databases
Section titled “Supported databases”DataSquares CDC supports all PostgreSQL-wire engines:
- PostgreSQL & PostgreSQL-compatible databases
- TimescaleDB
- YugabyteDB
- Neon & Supabase
- Google Cloud SQL, Amazon RDS & Azure Database for PostgreSQL
- AlloyDB
(MySQL and SQL Server CDC engines are currently in development).
Source prerequisites
Section titled “Source prerequisites”Your source PostgreSQL instance must enable logical replication:
- Logical WAL level: Set
wal_level = logicalinpostgresql.conf. - Replication user permissions: The connected database user must possess
the
REPLICATIONrole attribute and privilege to create publications on the target tables:ALTER USER datasquares_user WITH REPLICATION;GRANT SELECT ON ALL TABLES IN SCHEMA public TO datasquares_user; - Dedicated replication slots: DataSquares creates a dedicated replication
slot and publication per stream (
ds_cdc_<streamId>andds_cdc_<streamId>_pub) to ensure multi-stream isolation.
Creating a CDC stream
Section titled “Creating a CDC stream”- Navigate to Pipelines → CDC streams and click New CDC stream.
- Source: Select any connected PostgreSQL-family data source.
- Stream Name (Stream ID): Enter a unique identifier (up to 64 alphanumeric
characters, underscores, or hyphens, e.g.,
orders_realtime). - Tables: Specify a comma-separated list of fully qualified tables to
capture (e.g.
public.orders, public.order_items). You can capture up to 100 tables in a single stream. - Click Create stream. DataSquares provisions the managed Debezium capture worker, takes an initial consistent snapshot, and tails the write-ahead log (WAL).
Using CDC in a pipeline
Section titled “Using CDC in a pipeline”- In the Pipeline Editor, add an Extract step.
- Select the CDC tab and choose your Stream Name. No database credentials are required on the extract step — the supervisor manages secure ingest tokens internally.
- (Optional) Add Transform steps to clean, filter, or mask fields.
- Add a Load step configured with:
- Mode:
Merge (upsert by key) - Merge Keys: The primary key column(s) of the source table.
- Mode:
- Set the pipeline schedule to Micro-batch (every N seconds) (e.g.
15sor60s).
CDC metadata columns
Section titled “CDC metadata columns”Every extracted CDC record is enriched with system audit metadata:
| Column | Data type | Description |
|---|---|---|
_ds_op |
string |
The change operation: 'c' (create/insert), 'u' (update), or 'd' (delete) |
_ds_deleted |
boolean |
true if the record represents a deletion in the source table |
_ds_version |
bigint |
Microsecond timestamp ensuring deterministic out-of-order resolution |
When loaded into a database or managed dataset in Merge mode, deleted source rows are automatically removed or flagged according to your destination settings.
Resilient offset tracking
Section titled “Resilient offset tracking”CDC state and replication offsets are persisted to durable volumes. Container restarts, worker migrations, or platform upgrades resume seamlessly from the last committed LSN (Log Sequence Number) without re-snapshotting source tables.
Limits
Section titled “Limits”- PostgreSQL-family sources only in v1.
- Up to 100 tables per stream.
- CDC extract steps cannot combine with partitioned or incremental cursor settings.
Related
Section titled “Related”- Building a pipeline — Extract step configuration and micro-batch schedules.
- Where pipelines can write — Merge and delete handling.
- Pipelines API — CDC stream management endpoints.