PostgreSQL + Citus – multi master – replication of data

postgresqlreplication

I have a question, I have found a Citus extension which is recommended for a replication of data between multi-master nodes (I was using Galera Cluster prior to PostgreSQL).

However I cannot find any example of how to replicate tables without creating any additional tables (distributed) as replication has to work without any modification of C# code that is using PostgreSQL as a database.

It has to work in a same way as Galera Cluster (multi-master replication between nodes).

Perhaps I've tried wrong extension, but I've tried to review the options for 3 days and seemed like a good idea.

Perhaps someone could give the recommendation for a good extension that can offer multi-master replication without any additional change in existing queries that are used by our software.

Best Answer

Answer compiled from part-answers originally left as comments

Citus is not a multi-master solution. It's a sharding solution. It does not replicate data. It distributes data between PostgreSQL instances. Read How Citus Works article for further information. - Sahap Asci

From Multimaster in the PostgreSQL Wiki (contributed by dezso):

2ndQuadrant provides Bidirectional Replication for PostgreSQL (BDR). In this case updates can be performed at any node of the cluster and then propagated to other nodes. BDR is essentially asynchronous: changes are applied at nodes some time later after committing transaction at master and various ways of resolving conflicts are proposed. BDR is really fast (provides almost the same speed as hot standby), but certainly there is no global consistency in such model.