Supported versions
To propagate data from your AlloyDB instance to ClickHouse Cloud using ClickPipes, your instance must be configured for logical replication. This is supported from AlloyDB Version 14.Enable logical replication
To check if logical replication is enabled in your AlloyDB instance, run the following query against your primary instance:logical, logical replication is already enabled and you can skip to the next step. If the result is replica, you must set the alloydb.enable_pglogical and alloydb.logical_decoding flags to on in the primary instance.
To enable these flags:
- In the Google Cloud Console, navigate to the AlloyDB Clusters page. From the Actions menu for your primary instance, click Edit.
-
Scroll down to Advanced configuration options and expand the section. Under Flags, click Add a database flag.
- Add the
allowdb.enable_pglogicalflag and set its value toon - Add the
alloydb.logical_decodingflag and set its value toon
- Add the
- Click Update instance to save the configuration changes. It’s important to note that this action triggers a restart of the primary instance.
-
Once the status of the instance changes from
UpdatingtoReady, run the following query against your primary instance to verify that logical replication is enabled:The result should belogical.
Create a ClickPipes user and manage replication permissions
Connect to your AlloyDB instance as an admin user and execute the following commands:-
Create a dedicated user for ClickPipes:
-
Grant schema-level, read-only access to the user you created in the previous step. The following example shows permissions for the
publicschema. Repeat these commands for each schema containing tables you want to replicate: -
Grant replication privileges to the user:
- Create a publication with the tables you want to replicate. We strongly recommend only including the tables you need in the publication to avoid performance overhead.
-
To create a publication for specific tables:
-
To create a publication for all tables in a specific schema:
clickpipes publication defines the set of tables whose change events will be streamed to ClickPipes. We recommend against using FOR ALL TABLES unless you intend to replicate every table, as including unnecessary tables increases WAL traffic from Postgres to ClickPipes and reduces overall replication efficiency.
Configure network access
Next, choose how ClickPipes will connect to your AlloyDB instance.- Use Private Service Connect
- Allow ClickPipes IPs
- Use an SSH tunnel
For private connectivity from a ClickHouse Cloud service hosted on GCP, follow the GCP Private Service Connect guide to configure a reverse private endpoint for your AlloyDB instance.