2

Is there any way to sync three different postgres database on three different servers which is located in three different location and each server is responsible for writing different types of data however each server should have another servers data?

For Example: Server : A, B, C Data : 1, 2, 3.

Each server should have three data 1, 2 and 3.

However only:

  • Server A that's allowed to update the data 1.

  • Server B that's allowed to update the data 2.

  • Server C that's allowed to update the data 3.

yet each server should have the updated on each data.

1

1 Answer 1

2

PostgreSQL does not support sharding by default. However, there are some forks from Postgres sourcecode or some plugins, which support sharding to some extent(not sure that will suffice your requirement).

https://blog.dbi-services.com/sharding-with-postgresql/

Solution 1: My suggestion would be to manage sharding on application level, for e.g. store records starting with A-F on server 1, G- Z on server 2. But if you want to query all data together, this might not be good approach.

Solution 2: If you want to pull the data from diff servers or deal with it together. Then in that case, you should prefer replicating the data like Master-Master topology with Sticky sessions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.