Postgres Replication Tools for DDL - postgresql

Is there any tools for replication in postgres which can doing the following :
automatic DDL replication?
when master DB down, then slave will become the master DB immediately.
my company database is +- 5GB size
i have search some tools for replication which is slony and bucardo (and all trigger based replication system cannot doing the DDL replication)(source). and for 9.0 Streaming Replication (built in on postgres),Gabriel Weinberg (DuckDuckGo)said "Steve Signer wrote up some cases where you wouldn't want to/be able to use the built-in replication"
so 3 tools i found (slony,bucardo and 9.0 SR) , doesnt meet my criteria to do the postgres. is there any suggestion?
thanks

automatic DDL replication?
=> Use streaming replication, replicates everything.
when master DB down, then slave will become the master DB immediately.
=> pgPool does it's job over here, works fine.
my company database is +- 5GB size
=> That's very small, don't worry.

You can use debezium for replication transactions (insert, delete and update)... for ddl you can use kafka connect ;)

Related

backout plan for rds postgresql migration

I am migrating an RDS postgres from one account to another account using pg_dump/restore + DMS CDC for ongoing replication. For the backout plan i came across bi-directional replication.
is there any other method available with minimum to no downtime for the backout? please advise
PG 11.13

Replicate postgres database to Redshift - Ongoing replication

I have several postgres databases which need to be replicated as-is to a single aws redshift.
We have currently set up DMS services to the same. However, we keep encountering issues such as source database full, large column issues and most importantly the issue in DMS when new columns with defaults are added on postgres databases(This does not replicate with ongoing replication)
So, are there any other ways that we can set up this ongoing replication?

How to do logical replication on cascading standby server on postgres?

Is it possible to enable logical replication on standby server which is in cascading replication mode?
According Debezium connector for PostgreSQL docs:
As of release 12, PostgreSQL allows logical replication slots only on primary servers. This means that you can point a Debezium PostgreSQL connector to only the active primary server of a database cluster. Also, replication slots themselves are not propagated to replicas. If the primary server goes down, a new primary must be promoted.
Note.
There are discussions in the PostgreSQL community around a feature called failover slots that would help mitigate this problem, but as of PostgreSQL 12, they have not been implemented.
This feature is not implemented for the latest PostgreSQL release 13.
https://debezium.io/documentation/reference/connectors/postgresql.html

Replication of AWS RDS Postgresql into On-Premise Postgresql

I have a requirement of replicate data from AWS RDS Postgres(9.6) Database to On-Premise Postgres(9.5) Database. I have found stuff about replication from On-premise to On-premise. But How can we implement it for AWS RDS to On-premise?
I do this using Bucardo.
Check-out this: https://bucardo.org/Bucardo/
With Bucardo you can replicate RDS postgres instance to a slave postgres present somewhere, only configuring slave, so without the needs to configure RDS stuff.
Also you can do this with zero downtime.
Anyway I am not sure this will work using different versions of Postgresql. You should use same version if possible. I tested it with 9.4.x and it is working.
UPDATE
I can confirm that this is working also using different version of Postgres, for example I was able to replicate with these versions:
AWS RDS postgresql 9.4.x
On-premise postgresql 9.6.x
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.LogicalReplication
Beginning with PostgreSQL version 9.4, PostgreSQL supports the
streaming of WAL changes using logical replication slots. Amazon RDS
supports logical replication for a PostgreSQL DB instance version
9.4.9 and higher and 9.5.4 and higher. Using logical replication, you can set up logical replication slots on your instance and stream
database changes through these slots to a client like pg_recvlogical.
Logical slots are created at the database level and support
replication connections to a single database.
mind possible problems eg https://dba.stackexchange.com/questions/173267/aws-rds-postgres-logical-replication

View on slave postgres database

In postgres streaming replication master-slave setup, can we create views only on slave/standby server?
Can I have more than one standby slaves?
I am using postgresql 9.3.
re 1): this is not possible. The slave is always a 100% identical copy of the master.
re 2): yes this is possible. Quote from the manual:
You can have any number of standby servers