Skip to content

JOQULAR vs PouchDB & Others

Simon Y. Blackwell edited this page Apr 21, 2015 · 14 revisions

Introduction

JOQULAR is first and foremost a language for expressing queries. That being said, since the libraries associated with the reference implementation provides database like services, it is worth comparing it to more complete JavaScript databases.

We start this comparison with some general commentary about each of the alternatives and end with a side-by side table.

IndexedDB

IndexedDB is an evolving standard for browser based storage of JavaScript objects and primitives. The Mozilla Developer Network has excellent information on the topic. IndexedDB has a strong focus on transactional and non-transactional data integrity; however, it is relatively low level and only supports queries based on exact matches. All other comparisons must be done in the context of JavaScript code. The concept of classes is also missing in IndexedDB. Any data retrieved from the database must be mapped into application class instances by the programmer. In Chrome, object reads/writes are extremely fast; although index look-ups appear to be only moderately better that in memory array traversal (granted you do not have to manage a bunch of different arrays).

The JOQULAR library can optionally write objects and indexes to IndexedDB for persistence. However, it does not use the IndexedDB indexes, for each indexed class it just writes a nested object mapping object ids to their instances and another object which represents the index of all class instances. On Chrome, we have found it faster to read 100,000 simple objects into memory along with their index and conduct a JOQULAR search than it is to conduct a similar search in IndexedDB itself.

PouchDB

PouchDB provides a complete analogue to CouchDB in the browser, or on the server using node.js. In the browser, it leverages IndexedDB heavily or WebSQL if IndexedDB is not supported. In node.js is leverages LevelUP. PouchDB can also serve as a direct proxy to CouchDB to provide isomorphic client/server code with a well known, stable and understood backend, i.e. CouchDB.

PouchDB adds replication, triggers, versioning to what IndexedDB offers. We also find the Promise based code somewhat more approachable than IndexedDBs requests and event handlers. That being said, Google has a Promise based Closure library for IndexedDB as does Arron Powell with db.js.

Like IndexedDB, queries are heavy on code and there is no built-in concept of classes. And, although we have not tested it, but we are suspicious PouchDB will not run queries as quickly as JOQULAR. This being said, we do think PouchDB is way cool and way great!

TaffyDB

TaffyDB is similar to JOQULAR in its approach to matching patterns for database queries. If you are looking for a quick solution where persistence is not required and want something more approachable than PouchDB or IndexedDB, take a look. You loose transactions with TaffyDB, but you get joins ... something that is missing in most NoSQL databases. Like JOQULAR, TaffyDB it is trivial to add query predicates. However, for all its elegance, under the covers TaffyDB is implemented as a bunch of filters on arrays. There are no indexes, so scalability to large volumes of data may be an issue. Finally, TaffyDB development stalled about two years ago.

Comparison Table

Clone this wiki locally