The three objects
CDC ingestion is built from three SQL objects, each created once:- A location stores the connection details and credentials for the source database. See CREATE LOCATION (Postgres) and CREATE LOCATION (MongoDB).
- A stream binds to one source table or collection and tracks a consumed position in its change feed: a replication slot for Postgres, a change-stream position for MongoDB. You can read a stream directly with
READ_STREAMto inspect raw change events. See CREATE STREAM. - A CDC table consumes a Postgres or MongoDB stream and maintains the current state of the source table: one live row per key, with inserts, updates, and deletes applied in source order. See CREATE CDC TABLE.
SELECT * FROM orders returns the mirror at your query’s snapshot, on any engine in the account.
Both phases, and the ingest’s health, are visible in information_schema.cdc_ingests:
phase distinguishes the initial backfill from live streaming, and live_lag_ms shows how far behind the worker is.
What you can rely on
- Exactly once. The stream’s position and the rows it produced commit in the same transaction, so no change is lost or applied twice. There is no deduplication step to build or monitor.
- Always consistent. A query sees each change fully applied or not at all, at its own snapshot, on every engine.
- Fresh within seconds. A change is visible as soon as its batch commits. Background consolidation never delays it.
- Fast queries at high change rates, on your terms. You choose, per table, where the merge work runs. The default merges on read: ingestion stays append-only, superseded rows are excluded through deletion masks, and queries keep running as a single sorted, indexed scan while changes pour in.
merge_mode = 'write'merges on the write side instead: reads carry no merge work at all, which buys the last bit of analytical query performance, and the table stays open to direct DML. CDC tables covers the trade-off. - Isolated ingestion. The ingest worker runs on the engine where you execute
ALTER CDC TABLE ... RESUME. Every other engine reads the same continuously updated table from object storage without sharing compute with it. - Scale-out for hot tables. A partitioned Postgres source is ingested with one replication slot per partition, in parallel. See Postgres CDC.
Guides
- Postgres CDC: prerequisites, setup, partitioned sources, TOAST handling, operations.
- MongoDB CDC: prerequisites, schema inference, querying undeclared fields, operations.
- CDC tables: semantics, merge modes and their performance characteristics, lifecycle, monitoring.