Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best IndexedDB Wrappers [closed]

Tags:

indexeddb

I am just exploring various options for IndexedDB Wrapper and i've come across quite a few options as follows:

  1. YDN
  2. JQuery IndexedDb Plugin
  3. IDB Wrapper
  4. DB.js

But I am unable to find out which one of these is the best one? I want to use IndexedDB for an offline HTML5 powered Application to persist local data. Waiting for the best response from you all!

like image 958
rh979 Avatar asked Jan 25 '13 13:01

rh979


People also ask

Is IndexedDB deprecated?

The W3C has announced that the Web SQL database is a deprecated local storage specification so web developer should not use this technology any more. indexeddb is an alternative for web SQL data base and more effective than older technologies.

How long does IndexedDB last?

IndexedDB data belong to a type of temporary. So these data can be wiped out at any time. These data size/lifetime are managed by very new Quota Management API. In the future, IndexedDB could possibly used persistance type (not likely and not good idea too).

Should you use IndexedDB?

As I've alluded to, IndexedDB is a good fit if your client-side data needs are more complex than what Local/SessionStorage can provide (i.e. you're looking for more than a simple Key/Value store in your application). Yes, you can use JavaScript functions (such as JSON. stringify and JSON.

What is IndexedDB and is it worth it?

IndexedDB is very low level and perhaps one of the hardest browser APIs to deal with, so various wrappers are necessary to make it useful to most people. IndexedDB is a JavaScript API found currently in Firefox, Chrome, and IE10 that implements a client side data store for web applications.

How should I store large items in IndexedDB?

The same is true if you store large items like images, music, or video in IndexedDB. Store each item with its own key rather than inside a larger object, so that you can retrieve the structured data without paying the cost of also retrieving the binary file. As with most best practices, this is not an all-or-nothing rule.

Do I need jQuery for IndexedDB and idbwrapper?

Both jQuery IndexedDB and IDBWrapper to me look much more like proof-of-concepts than fully fledged attempts to provide a programming interface to IndexedDB, especially the jQuery one, I don't see why jQuery is needed for it, you aren't working with the DOM.

What is idbwrapper and why is it useful?

Jens Arps has been working on IDBWrapper, a JavaScript library that wraps the IndexedDB API and makes it much easier to work with. IndexedDB is very low level and perhaps one of the hardest browser APIs to deal with, so various wrappers are necessary to make it useful to most people.


Video Answer


1 Answers

I wrote the db.js library so I might be a bit biased but it's main goals were to:

  • Add Promise based callback handling rather than wiring up events to onsuccess and the like
  • Add a simple and fluent API for querying that relied on method chaining and ultimately looked like JavaScript code
  • Use a JavaScript object to define your database schema
  • Handle connection 'pooling'

It wasn't meant to be fancy or solve any really complex implementation issues, just API issues (or what I see as API issues).

PouchDB on the other hand is a more complex solution attempting to solve the problem of data storage for online and offline, as it syncs nicely to a CouchDB instance.

Both jQuery IndexedDB and IDBWrapper to me look much more like proof-of-concepts than fully fledged attempts to provide a programming interface to IndexedDB, especially the jQuery one, I don't see why jQuery is needed for it, you aren't working with the DOM.

Ultimately there's no right answer here, you're better off trying out one of the libraries, if it doesn't work for you then move on to the next one and keep going until you find the library that works best for your projects.

like image 189
Aaron Powell Avatar answered Oct 11 '22 17:10

Aaron Powell