Database synchronization if this is a very complex issue. The easiest approach is to save the record at the application level (or, despite the fact that the sqlite user shell) of all queries is executed against each system, and then run them again during synchronization.
This becomes problematic if you have multiple sources or two-way synchronization. Queries that run perfectly in the same database may fail on each other due to the different order of operations (assuming referential integrity is enabled).
, . , , . , , , , , .