Hi Gopi,
Just wanted to add more details to your question regarding the applicationdb (postgres), the postgres replication between primary and standby uses repmgr. The replication should be near real time. It is done asynchronous to the the transaction committing on the primary but should happen soon after the commit. So, the standby should be close to the state of the primary at all time unless there is a hiccup in the network connection between primary and standby or the standby goes down. When the primary goes down, the standby will automatically take over. When the primary is ready to come back up, the process requires some manual intervention. The steps to bring back the primary are documented in "Switching from your standby server back to your primary server" in the enterprise install guide as attached in the install guide above. A few additional things to mention before bringing back the primary:
-
The first step should be to shut down the application servers.
-
At no time should the primary be brought back up while the application servers are up. This could lead to a split brain situation.
-
At no time should the primary be brought back up before a backup of the standby is taken which in turn should not happen till the application servers are shut down.