Galera Mariadb Multi-Master Replication I am trying to setup a cluster of 3 servers in 3 different locations; Dallas-US, London-UK, Mumbai-India. On each location I have setup a webserver and db server. On db server I have configured Galera Mariadb Multi-Master cluster to replicate db among all three servers. My each webservers are connected with local IP to their regional db server. I am expecting that my Dallas webserver will fetch db records from Dallas db server only; London webserver from London db server only and Mumbai webserver from Mumbai db server only. So I am having this setup
Dallas: 1 Webserver, 1 db server connected to webserver with local IP
London: 1 Webserver, 1 db server connected to webserver with local IP
Mumbai: 1 Webserver, 1 db server connected to webserver with local IP
Everything is working well but I have found that mysql query takes much time above 100s while fetching record. I have tried Mariadb with single instance and its fetching data within 5s.
What am I doing wrong? Is it possible to setup something like this where every db server will geo-replicate its data but every webserver will fetch data only from its local db server?
The performance is going to be atrocious with your setup, especially in writes because every write has to be acknowledged by at least one remote node. You will also get an astronomical number of deadlocks.
If you need geo-replicated synchronous redundancy, you would be batter off with with DRBD for block level replication. Performance will still be terrible on commit latency but not as terrible as with Galera.
You need to rethink your requirements and your approach to fulfilling them.