Database synchronization server with local

I have a local application using SQLite. Whenever he has access to the Internet, he requests the entire database from the server and recreates the local one from it. Local and server databases have the same structure, mainly the local point is to guarantee functioning, even if the Internet is not available.

This is a very inefficient way to do this. My question is, how to request only data that is missing?

Should I send the last identifier from each local table and send the server with this identifier? What happens if an existing ID changes? This means that all data must be verified, but sending the entire database to check and return changes or additions also seems silly.

Configuration is a local SQLite, a MySQL server. I could probably change the server to SQLite if it recommended.

EDIT:
Several clients make requests to the same MySQL Database server, PHP processes the request and responds.

How would you handle this?
Thanks.

+4
source share
1 answer

I either mark the time in the rows of the database and fetch by date, or rsync (or librsync or similar) to synchronize the database files.

+3
source

All Articles