42

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!

Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
rh979
  • 657
  • 1
  • 5
  • 13
  • also add Linq2IndexedDB for comparison as well – rh979 Jan 25 '13 at 13:37
  • 6
    There is no *best* tool. There is only the best tool to solve a specific problem in a specific way. – Philipp Jan 25 '13 at 13:38
  • I think one of the things you have to look at is the provided support they give, how frequently they update, the community behind it, documentation, dependencies, ... For every one there are going to be other parameters important. I wrote one my self some time ago, because I couldn't find one which supported IE. Also I wanted to use the .NET way of LINQ to query. As mentioned before I wrote the linq2indexeddb API (http://linq2indexeddb.codeplex.com). Advantage of mine is the fact he works in Windows 8 too. – Kristof Degrave Jan 25 '13 at 14:03
  • See also my own library at https://github.com/editor/indb – buley Jan 29 '13 at 22:25
  • Also see: [SequelSphere](http://www.sequelsphere.com/) It provides a SQL wrapper to IndexedDB, along with also supporting LocalStorage for older browsers. – John Fowler Feb 01 '13 at 15:46
  • warning: I see a large memoryleak bug unresolved in linq2indexeddb http://linq2indexeddb.codeplex.com/workitem/23451 – jason Mar 05 '13 at 21:38
  • 12
    Since this question is rather old but still comes up high in Google search for indexedDB libraries, I wouldn't be informative to not mention Dexie.js here, www.dexie.org. – David Fahlander Dec 04 '14 at 00:17
  • 2
    If you want to work with a wrapper for IndexedDB, WebSQL, or localStorage, then you should definitely checkout: https://github.com/mozilla/localForage – Benny Code Feb 25 '15 at 16:10
  • localForage is by far the best choice. Thanks a lot @BennyNeugebauer for your suggestion! I have investigated this hardly and no solution compares to localForage, maintained by Mozilla. – Paulo Coghi Oct 22 '16 at 03:37
  • Check it out JsStore. It provides sql like api , runs in web worker, you can execute complex query and much more.It has good documentation with example for each api. Link - http://jsstore.net/ – Ujjwal Kumar Gupta Aug 28 '17 at 07:39
  • I ran across jsstore, looks fine. (I see now the author of the library posted the comment before me :) – Dalibor Nov 18 '21 at 10:34

1 Answers1

36

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.

crimbo
  • 10,308
  • 8
  • 51
  • 55
Aaron Powell
  • 24,927
  • 18
  • 98
  • 150
  • Is db.js still being developed? The last commit on the github page was 2 months ago. – bigblind Oct 11 '13 at 11:27
  • 6
    @bigblind the short answer is yes, it currently does all I need it to do so I haven't invested time trying to guess at what problems it doesn't solve. – Aaron Powell Oct 14 '13 at 03:58
  • Some more documentation would be nice, If I find time, I could help documenting it, but I have exams coming up. – bigblind Oct 14 '13 at 20:05