Setting up RDM metadata replication
This document outlines a recipe for replicating RDM metadata using PostgreSQL logical replication.
Problem Out line
- How do you setup replication when the “publisher” runs in a Docker instance?
- What needs to be replicated?
- Dumping scheme from production PostgreSQL
- Generating snapshot to seed our “subscriber”
- Run and monitor replicated data?
- Do we need to create JSON record views of the assemble objects, if so does this have to be done in Python using the RDM ORM or do we have other options?
- Can we go from replicated database to dataset collections quickly?
Setting up the publisher
- Create a “publisher” using the CREATE statement described at https://www.postgresql.org/docs/14/sql-createpublication.html
- Adjust the containers firewall and PostgreSQL configuration in the container to allow reading the PostgreSQL database from the machine where the data warehouse is implemented
- Test connections from the “subscribe” machine
Setting up the subscriber
- On the “subscriber” system make sure you can connect and browse the “publisher” database
- Install a snapshot from the “publisher” system
- Setup a subscription using CREATE per the instructions on https://www.postgresql.org/docs/14/sql-createsubscription.html
- Montor to make sure data is flowing from the publisher to the subscriber, see https://www.postgresql.org/docs/14/logical-replication-monitoring.html
Additional References
- https://www.postgresql.org/docs/14/warm-standby.html