I have a postgresql server process each running in my desktop and the laptop.
Both servers have a database called MG with exactly same scheme/layout. Now I enter the data in to similar tables but at differing times.
I generally keep the primary keys separate so that they don't clash with each other. eg: oddnumber pkey for laptop and even number for desktop.
Now how do I synchronize the data between the desktop and laptop cleanly?
DESK:ADDRESS ----- LAP:ADDRESS
DESK:TO_DO ----- LAP:TO_DO
DESK uses pkeys like 1001... for inserts
LAP uses pkeys like 2001... for inserts
I need both update for the modified records and insert for new records. But how?
Synchronous Replication. PostgreSQL streaming replication is asynchronous by default. If the primary server crashes then some transactions that were committed may not have been replicated to the standby server, causing data loss. The amount of data loss is proportional to the replication delay at the time of failover.
For replication to be achieved in PostgreSQL there must be two servers that can communicate with each other. It will identify this server as master, which is the master server or the production server and the other one is the Slave server or Replica server or standby server that will have a copy of master server data.
It looks like rubyrep would work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With