Mysql has some replication resource however it is necessary to understand the scope of your project to know which fits best.
The Mysql Replication allows data from a Mysql database server (the master) to be copied to one or more Mysql database servers (the slaves). Replication is asynchronous by default; slaves do not need to be permanently connected to receive updates from the master. Depending on the configuration, you can replicate all databases, selected databases or even selected tables within a database.
Another resource is Mysql Cluster, this allows to be configured for High availability (fault tolerance due to unavailability) and Scalability (expandable capacity and performance). It has a more complex configuration but more robust and with a very rich documentation to support, if you have time to study and implement this technique.
For your specific case, I think a replication configuration along with a load balancing server would solve. I have already made a setup using the following tutorial:
- Set up a Master-to-Master replication (in English)
- How to use haproxy to set up a Balancing load for mysql (English)
You could use the first VPS to install haproxy, with a mysql instance running on localhost only (haproxy will access locally)
And with the other 2 VPS also in load balancing.
You want to sync only the data or want to keep a copy of data and structure?
– LeonanCarvalho
sync only the data Example = I have the 3 VPS and in each I limit the access of users to 100 people per database in each VPS or 3 banks to synchronize the data 300 people will access the same data in 3 VPS want to do this to limit the VP overloadLet’s say so when a VPS has 100 users the program redirects to the other bank that is synchronized with the 3 and real time
– Z04h
In the other 2 there would be need for reading and writing?
– LeonanCarvalho
Oh ta I don’t know because I want to turn 3 VPS with 1 database each to sync to work with if Foce a single bank
– Z04h
But these databases will have different data and should synchronize among themselves? I’m afraid that’s not possible.
– LeonanCarvalho
You need a load Balancing, so you can distribute the load between the 3 servers.
– LeonanCarvalho
They will have the same structures and the same data I want to synchronizelos para quando algo algo for altera no banco 1 da VPS 1 o banco 2 da VPS 2 e o banco 3 e VPS 3 tinha a mesma informação alterado no banco 1 da VPS 1 e vise versa para que eles trabalhar com um só para que nem um banco/VPS sobrecarregue com muitas pessoas acessando
– Z04h
This would also help me if for some reason a VPS drops I have 2 more with the same data so that my application does not get out of AR
– Z04h
I posted an answer, you will have to analyze which shape best suits your project. There is no very simple way to do this "plug-in-play" type, not even the most correct one. Instead of having 3 VPS you could have a dedicated one with SSD or RAID for a better performance for example. Everything will depend on your project.
– LeonanCarvalho