P
P
Pavel K2018-03-10 01:16:37
MySQL
Pavel K, 2018-03-10 01:16:37

Saving database data and restoring / synchronizing with the server when the connection is broken, how best to implement?

Greetings!
I write software, I use the database tightly, in my case MySql (MariaDB).
Problems begin when the user has an extremely unstable connection.
Of course, I use transactions, there are no problems with the integrity of the data itself, there are problems in convenience - with each break, a message is displayed that try again and in extreme cases you have to press it 100500 times until a normal connection appears, this, I think, pisses me off.
//--Main question:
So, how can this problem be solved, ideally, I would like that, even without a connection, the user can work relatively normally (what data is loaded with those and works), and when the connection appears, that's all changes would be synchronized with the server?
For example, use a local database on the device, i.e. create the same tables, only empty and load the data only those that are needed, respectively, change / insert them. But then how to synchronize them with the server, so that you don’t have to write all this logic by hand? Is there any ready-made method for this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question