- Newest
- Most votes
- Most comments
Yes, it is possible to have multiple replication slots in Aurora PostgreSQL 13, including a combination of slots using different logical decoding plugins like test_decoding and pgoutput. However, there are some important considerations to keep in mind:
-
Resource usage: Each replication slot consumes resources on the database server. Multiple slots can increase the load on your system, especially if they are actively used.
-
WAL retention: Replication slots prevent the write-ahead log (WAL) from being removed until all slots have processed the data. If one slot falls behind, it can cause WAL buildup, potentially leading to increased storage usage and performance issues.
-
LSN management: Each replication slot tracks its own Log Sequence Number (LSN). The database will retain WAL segments until all slots have consumed them. This means that if one connector falls significantly behind others, it can impact the overall replication process and storage usage.
-
Performance impact: Using multiple slots and connectors can increase the load on your database, potentially affecting its performance. This is especially true if you're replicating a large number of tables or processing high volumes of changes.
-
Complexity: Managing multiple slots and connectors adds complexity to your setup, which can make troubleshooting and maintenance more challenging.
While it's technically possible to set up multiple slots as you described (test_decoding_slot1, test_decoding_slot2, pgoutput_slot1), it's generally advisable to carefully consider your use case and requirements before implementing such a configuration. If you need to process different tables with different connectors, you might want to explore other options, such as:
- Using a single slot with a connector that can filter and route changes to different destinations based on the table.
- Implementing a custom solution that can read from a single slot and distribute the changes to multiple consumers.
If you do decide to use multiple slots, it's crucial to monitor them closely for replication lag, WAL retention, and overall system performance. Regularly check the status of your replication slots and ensure that all connectors are keeping up with the changes to avoid potential issues with LSN advancement and WAL buildup.
Sources
Cross-account Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL migration with reduced downtime using AWS DMS | AWS Database Blog
Monitoring the write-through cache and logical slots for Aurora PostgreSQL logical replication - Amazon Aurora
