1

What are the advantages of cascading replication in PostgreSQL?

I have done testing with three nodes.

M1 ----> S1 -----> S2

What is the use if my primary server (M1) goes down (failover)?
Where is the secondary standby server (S2) useful for us in this setup?

Erwin Brandstetter
  • 185,527
  • 28
  • 463
  • 633
user37651
  • 31
  • 1
  • 3

2 Answers2

1

If you do a switchover from master to slave1, you still have a spare slave if the now active master also fails. Otherwise you'd be running with no failover computer at all. – a_horse_with_no_name

mustaccio
  • 28,207
  • 24
  • 60
  • 76
0

If Your application can get data from more than one database You can use cascading replication for load balancing(One App get data from multiple bases) but only in case when it's synchronous replication(in case of cascading rep. it's heavy).

In case of M1 fail You can do Python script that will place S1 as master(including updating port, config, and connecting with S2). It's not hard, with Python You can do it in about one hour. Other option is Python script that will restore M1 with data from S1, use Python library: PSYCOPG2

Czachovic
  • 162
  • 1
  • 10