How to connect AWS Aurora to Materialize
To connect AWS Aurora as a Postgres Source, as a superuser, make these changes to the upstream database:
-
Create a DB cluster parameter group for your instance. Use the following settings:
Set Parameter group family to your version of Aurora PostgreSQL.
Set Type to DB Cluster Parameter Group.
-
In the DB cluster parameter group, set the
rds.logical_replication
static parameter to1
. -
In the DB cluster parameter group, set
max_replication_slots
,max_wal_senders
,max_logical_replication_workers
, andmax_worker_processes parameters
based on your expected usage.Parameter Recommended Minimum Value max_replication_slots The combined number of logical replication publications and subscriptions you plan to create. max_wal_senders The number of logical replication slots that you intend to be active, or the number of active AWS DMS tasks for change data capture. max_logical_replication_workers The number of logical replication slots that you intend to be active, or the number of active AWS DMS tasks for change data capture. max_worker_processes The combined values of max_logical_replication_workers
,autovacuum_max_workers
, andmax_parallel_workers
. -
The Materialize instance will need access to connect to the upstream database. This is usually controlled by IP address. If you are hosting your own installation of Materialize, add the instance’s IP address in the security group for the DB instance.
-
Restart the database so all changes can take effect.
-
Create a publication with the tables you want to replicate:
For specific tables:
CREATE PUBLICATION mz_source FOR TABLE table1, table2;
For all tables in Postgres:
CREATE PUBLICATION mz_source FOR ALL TABLES;
The
mz_source
publication will contain the set of change events generated from the specified tables, and will later be used to ingest the replication stream.
For more information, see the AWS Aurora documentation.