Synchronize two Mysql databases

Asked

Viewed 2,398 times

0

I am developing a web application and would like to get the system working both online, how much offline. The idea is to keep a local database that responds when the user is offline, but I don’t know how I can do to synchronize the data between the local bank and the remote when the connection is reestablished.

I know how to see if the computer is with internet or not, just do not know how to update the data after it is with internet.

  • 1

    You should as soon as the connection is established make an HTTP request to the server sending the local data and inserting/updating in the database. It’s not much of a secret.

1 answer

0


You must work with Mysql Replication, which consists of a 1 master database where inclusions are made and several slave banks for reading. This mechanism is interesting for load balance, data integrity and performance.

Overview of the tool.

https://dev.mysql.com/doc/refman/5.7/en/replication.html

Here are the directions to perform the settings:

https://dev.mysql.com/doc/refman/5.7/en/replication-configuration.html

Be sure to read carefully the links I gave you, paying attention to the version of your Mysql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.