AlloyDB Change Data Capture Setup on Google Cloud with Streamkap
streamkap_user
. The Connector will use this collection for managing snapshots. Below is an example script that does that.
streamkap_signal
. It will not be recognised if given another name.streamkap_signal
table.FOR ALL TABLES
publications to include/exclude tables.If you set up a FOR ALL TABLES
publication and later decide to change that, you have to drop the publication and create another to include specific tables e.g. CREATE PUBLICATION ... TABLE table1, table2, table3, ...
.However, any change events that occur before the new publication’s created will not be included in it, so a snapshot’s required to ensure they are not missed by your Streamkap pipelines.You should also stop the Source before changing the publication.WITH REPLICATION
privileges as per Create Database User.5432
.
streamkap_user
.
streamkap_user
. See Enable Snapshots for setup instructions.streamkap_pgoutput_slot
.streamkap_pub
.DatabaseName_TopicName
blob
, binary
, varbinary
should be interpreted. Your destination for this data can impact which option you choose. Default is bytes
..csv
file without a header.Managing PostgreSQL upgrades
Replica identity and deleted records (PostgreSQL 13 and newer)
REPLICA IDENTITY
table setting controls what data is logged for row updates and deletes.By default, only the primary key and Streamkap metadata column values are retained for deleted records. All other columns will be empty. This leaves you with an incomplete record.If you require - for auditing and historical tracking purposes - all column values for deleted records, or if your deletion strategy for your destination is ‘soft deletes’ (retain the deleted record with a deletion flag), you should set the REPLICA IDENTITY
to FULL
for all capture tables.Capturing partitioned tables (PostgreSQL 13 and newer)
publish_via_partition_root
on the publication.By default, changes to partitions are published from the partition itself. The connector expects changes to come from the root table.To ensure compatibility and consistent replication, enable this setting:ALTER PUBLICATION streamkap_pub SET (publish_via_partition_root = true);