Materialize Documentation
s
Join the Community github/materialize

How to connect AWS Aurora to Materialize

NOTE: Aurora Serverless (v1) does not support logical replication, so it’s not possible to use this configuration for Postgres CDC.

To connect AWS Aurora as a Postgres Source, as a superuser, make these changes to the upstream database:

  1. 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.

  2. In the DB cluster parameter group, set the rds.logical_replication static parameter to 1.

  3. In the DB cluster parameter group, set max_replication_slots, max_wal_senders, max_logical_replication_workers, and max_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, and max_parallel_workers.
  4. 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.

  5. Restart the database so all changes can take effect.

  6. 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.