Mysql – PHP MySQL peer to peer

MySQLPHP

How do I achieve with MySQL to have peer to peer data shared between network? Let's say I have 5 different nodes of MySQL servers and would like the data to be shared peer to peer rather than master-slave or multi-master having all transactions data integrity in check.

If you can show steps or even guide to do this it would be really great.

Best Answer

Galera clustering does essentially what you describe. Each "node" acts like a MySQL server for reading and writing. Each node always contains the same data.

Under the covers is M-S / M-M, plus extra glue so that, on the surface, it does not feel like those replication technologies.

Galera is included in PXC and MariaDB, or you can install it on top of MySQL. Competing products include Clustrix and InnoDB Cluster.

Caution: 3 nodes is recommended; 5 is getting rather large. To maintain the peer-to-peer, each node needs to talk to each other nodes; the number of connections grows quadratically.

https://mariadb.com/kb/en/the-mariadb-library/galera-cluster/