Mysql Database Synchronization between Servers (VPS)

2

I would like to synchronize my databases that are hosted between 3 different VPS, I would like to synchronize this data in real time when a record is changed in a database in a certain VPS automatically changes in the other databases in the other VPS (I program in Delphi and accepted tips anyway thank you very much) just remembering that VPS servers have Fixed Ip

    
asked by anonymous 31.07.2017 / 20:37

1 answer

1

MySQL has some replication feature but you need to understand the scope of your project to see which fits best.

MySQL Replication allows data from a MySQL database server (the master) are copied to one or more MySQL database servers (the slaves). Replication is asynchronous by default; Slaves do not need to be permanently attached 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 feature is MySQL Cluster , which allows you to configure it for High availability (fault tolerance due to unavailability ) and Scalability (expandable capacity and performance). It has a more complex yet more robust configuration and a rich documentation to support, if you have time to study and implement recommend this technique.

For your specific case, I think a replication setup along with a load-balancing server would solve. I already did a setup using the following tutorial:

  • Setup a Master-to-Master Replication a>
  • How to use haproxy to set up a load balancing for mysql
  • You could use the first VPS to install haproxy, with a mysql instance running on localhost only (haproxy will access it locally) And with the other 2 VPS also in load balancing.

        
    01.08.2017 / 16:04