Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IndexedDB, WebSQL in 4 Months

I've got a bit of a problem, I'm about to start a 4-6 month project which will need offline support. AppCache is awesome and accepted as the standard but the big browsers are still undecided about the database implementation with Opera, Safari and Chrome opting for WebSQL (SQLite) and Mozilla and supposedly IE backing IndexedDB.

I know that Chrome will also develop an IndexedDB option in the future but I could not find any info about any release dates etc.

Now, in 4-6 months, lets call it November I want to have a system that supports most (does not have to be all) latest version browsers (assuming IE9 is out, FF4, and Chrome 6). I don't really want to have a IndexedDB/websql dual implementation. The thought of using localStorage as a big ugly blob database gives me the shivers and I would love not to use Gears.

What do you, my esteemed colleagues recommend I do, what path should I follow? Which pill to take?

Thanks All

Guido

like image 607
gatapia Avatar asked Jul 01 '10 02:07

gatapia


People also ask

Is WebSQL deprecated?

WebSQL in third-party contexts is now deprecated. Removal is expected in Chrome 97. The Web SQL Database standard was first proposed in April 2009 and abandoned in November 2010. Gecko never implemented this feature and WebKit deprecated this feature in 2019.

What is IndexedDB and WebSQL?

IndexedDB used to have a competing spec called WebSQL Database, but it was deprecated by the W3C. While both IndexedDB and WebSQL are solutions for storage, they do not offer the same functionalities. WebSQL Database is a relational database access system, whereas IndexedDB is an indexed table system.


1 Answers

i would indeed go for (a.o.) localstorage. I wrote a small proof of concept of such an offline web-app earlier this year (cfr. this blogpost and the offline-enabled webapp here), the basic approach being;

  • put data in arrays/ objects
  • use standard javascript functions to do CRUD (or go for jlinq)
  • json-ify the array/object for storage
  • use a storage-abstraction library like persistjs to store/ retrieve json-ified array/object
like image 93
futtta Avatar answered Oct 04 '22 03:10

futtta