DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

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.[01]

Source Code
https://github.com/apache/pouchdb[02]
Country of Origin
US
Start Year
2010 [15]
Project Type
Open Source
Written in
JavaScript
Derived From
CouchDB
Inspired By
CouchDB
License
Apache v2

Database Entry

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.[01]

Checkpoints[05]


PouchDB allows users to enable or disable replication checkpoints (which would be modified based on system performance goals and/or usage), which are used for synchronization across the local and remote servers.

Compression[06]


PouchDB doesn't currently support compression by default, however there is a plugin (Transform Pouch) that allows for compression of data.

Data Model[07][08]


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

Foreign Keys[09]


Indexes[10]


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

Logging


TODO: can't unselect / delete this option.

Query Execution


PouchDB can use map/reduce or create MangoQueries (used to build secondary indexes). Users can create an empty query to speed up the query. By dividing into map and reduce, parallelism can speed up the process.

Query Interface[11]


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

Storage Organization[12][13]


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).

Stored Procedures[09]


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

Views[07][14]


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.

Citations

15 sources
  1. PouchDB, the JavaScript Database that Syncs! pouchdb.com
  2. GitHub - apache/pouchdb: :kangaroo: - PouchDB is a pocket-sized database. · GitHub github.com
  3. Introduction to PouchDB pouchdb.com
  4. Apache CouchDB - Wikipedia wikipedia.org
  5. PouchDB 6.3.0 pouchdb.com
  6. GitHub - pouchdb-community/transform-pouch: PouchDB plugin for modifying documents before and after storage in the database. · GitHub github.com
  7. FAQ pouchdb.com
  8. https://pouchdb.com/guides/documents.html pouchdb.com
  9. https://db-engines.com/en/system/PouchDB;Tibero db-engines.com
  10. pouchdb/packages/node_modules/pouchdb-find at master · apache/pouchdb · GitHub github.com
  11. API Reference pouchdb.com
  12. http://blog.nparashuram.com/2011/03/indexeddb-store-in-your-browser.html nparashuram.com Dead — Check Archive
  13. https://dbdb.io/db/couchdb dbdb.io
  14. Materialized views in PouchDB - Stack Overflow stackoverflow.com
  15. Initial skeleton. github.com
Revision #23 Last Updated: