Syncing objects to a remote server, and caching on local storage
Posted
by
Harry
on Programmers
See other posts from Programmers
or by Harry
Published on 2012-10-25T10:19:25Z
Indexed on
2012/10/25
11:15 UTC
Read the original article
Hit count: 225
caching
|synchronization
What's the best method of sycing objects (as JSON) to a remote server, with local caching?
I have some objects that will pretty much just be plain-text with some extra meta-data. I was thinking of perhaps including a "last modified date" for both Local storage and Remote storage. This could then be used to determine which object is the most recent.
For example, even though objects will be saved to both local and remote when they are saved, sometimes the user may not have internet access, or the server may be down, or any other number of things. In this case, the last modified date for remote storage would be reverted to its previous date. Local storage would remain as it is. At this point, the user could exit the application, and when they reload the application would then look at the last modified dates of the local and remote storages, and decide.
Is there anything I'm missing with this? Is there a better method that I could use?
© Programmers or respective owner