PouchDB

PouchDB is a free and open-source JavaScript DBMS inspired by Apache CouchDB (document-oriented NoSQL DBMS) that is designed to run inside a web browser. It was designed with the intention of serving web developers and to run smoothly within a browser. Applications utilize a system where, while offline, data is stored locally, then, when back online, the data is synchronized with Apache CouchDB and between clients. Thus, data is synchronized regardless of login context.

Stored Procedures

Supported

PouchDB allows for stored procedures by using view functions in JavaScript.

Storage Organization

Indexed Sequential Access Method (ISAM)

When offline, data is stored locally using WebSQL (deprecated) or IndexedDB, depending on the browser. For IndexedDB usage, the method of storage organization is ISAM. When online, data synchs with CouchDB (and other servers). CouchDB storage uses copy-on-write to update database files. (TODO: select two options).

Logging

Physical Logging

TODO: can't unselect / delete this option.

Indexes

B+Tree

Starting with version 2.2.0, PouchDB supports secondary indexes using B-trees. The default index is build on the _id field.

Views

Materialized Views

PouchDB supports creating materialized views of the results of a query. It's very similar to CouchDB however PouchDB uses ASCII ordering to order view query keys. It also does not support the offset property that CouchDB does. Instead, a skip parameter is used instead of an actual offset.

Data Model

Document / XML

PouchDB uses an unstructured document data model, where documents are JSON serializable. It also supports attachments, which store binary data.

Isolation Levels

Not Supported

Concurrency Control

Multi-version Concurrency Control (MVCC)

PouchDB's concurrency control policy is multi-version concurrency control, allowing consistency of reads.

Query Interface

Custom API

PouchDB utilizes a custom API for its query interface. As it is designed for web browsers, this API supports callbacks, promises, and async functions.