Mysql – Solution for deploying multiple instances of Django Server with Database replication

MySQLpostgresqlreplication

have written a Django application that reads / writes data into a postgres database, at the moment I have been deploying one of these devices per client. I am faced with having to deploy multiple instances of this across a client site. I need to keep all databases consistent across the instances with each instance talking to its own database (essentially a multi-master setup)

I have been looking into various replication solutions (mySQL Cluster, PGCluster) but these all seem to require that I have each instance accessing the database through one location, whereas I want each instance to read /write to its own database and the databases to be kept consistent across all devices. Does anyone have any ideas of a solution that may work for this or somewhere else I could look?

Its also worth noting that the databases are write heavy rather than read heavy

Best Answer

I'm going to highlight one of the products listed in the wiki link provided by Jack Douglas.

Galera is a product I've been hearing a lot about recently, but have not had a cause to implement it yet into a production environment.

Back in July, Percona wrote a brief blog about implementing it, but mentioned there was no 'production' release at that time.

They've since released the first major version, v1.0. And Vladimir has been shedding more light on it this month. And with some benchmarks

Due to your write-heavy environment, I highlight this use-case:

Distributing writes across the cluster will harness the CPU power in slave nodes for better use to process client write transactions. Due to the row based replication method, only changes made during a client transaction will be replicated and applying such a transaction in slave applier is much faster than the processing of the original transaction. Therefore the cluster can distribute the heavy client transaction processing across many master nodes and this yields in better write transaction throughput overall.

Disclaimer: I'm not affiliate with Galeria or Percona, and have not used it personally...yet.