Since websql is depreciated so I was looking into IndexedDB for browser offline storage facility,but I found that indexedDB has undergone major design change after the example showed in HTML5Rocks(http://www.html5rocks.com/en/tutorials/indexeddb/todo/) and this(http://www.kristofdegrave.be/2011/10/indexed-db-creating-opening-and.html) is the new tutorial of indexedDB. The code seems to be bit complicated. I want to ask has anyone used it for offline storage of data?My requirement is the application which I am developing should work even if there is no internet connectivity and and all data will be sync to remote DB when internet connectivity is available.is it possible?
Asked
Active
Viewed 634 times
0
-
If you want your website/app to load even without an internet connection, you'll have to use application cache. Once you've got your web page/app loading without an internet connection, you can you indexedDB and anything else you want, so long as it is on the client side. If you use anything server side, you will have to check for an internet connection first. – starbeamrainbowlabs Jul 25 '12 at 12:13
2 Answers
1
Yes you can use indexedDB for maintaining a offline data copy. But there are size limits which are browser specific set on the indexedDB. Firefox for example has 50MB whereas IE has 10MB. Using more than this requires user consent.

ThirdOne
- 1,227
- 9
- 13
-
can you correct my approach? suppose there is a table on my page which is exactly same as backend DB table,so for offline support I should copy entire data of backend table to browser indexedDB and then any CRUD operation only change local table and when internet connection is there then the data will be sync with actual backend table..is it correct approach? – Rajesh Jul 25 '12 at 12:27
-
Depends on the size of the table. If it is going to contain a few thousand rows, syncing it locally makes sense. Otherwise just store a subset. – ThirdOne Jul 25 '12 at 13:08
0
currently indexDB is only supported by FF and chrome. don't you have browser compatibility issue?

user10
- 5,186
- 8
- 43
- 64
-
Ya that is one more concern,since indexedDB is still in drafting phase but sooner this will be introduced in other browser as well.. – Rajesh Jul 26 '12 at 09:13
-
how soon? it might take an year.It is still not standardized. so they can change it's behavior at any time. – user10 Jul 26 '12 at 11:43
-
FWIW, the devs claim the first version of the spec is basically done and that the implementation in the current version of Firefox is unlikely to change much (Chrome still lags behind a bit). Then IE10 will likely support that same spec. – dumbmatter Jul 26 '12 at 13:45