This is my first microblog, and I'm talking about some of the small problems and workarounds that are encountered when using the local database and the online database while doing Android.
1, the local database and the online database is not synchronized with the problem: because I do the sports app All the data is updated in real-time, so if the exchange of local data and online data will be unreasonable, often error. So I store daily motion data locally (up to a maximum of up to a few days of local data) and upload the data as soon as it's networked.
2, upload data processing problem: The previous practice is to download online data, check with local data is different, if different, save a different place, upload it and update it. Later found that this method is too complex, data processing time is relatively long, if the user short time networking or network status is not good is prone to errors. Later, the local data upload, due to the small amount of data, upload quickly, for the data processing part on the server, reduce the number of data interaction, reduce the probability of error occurrence.
Of course, there are some other minor problems, because the time is a bit long, remember it is not clear, the need for people can contact me to communicate with each other. Just write down the humble opinion here, and hope for some people to bring help.
Considerations for handling local and cloud database storage