Featured in Architecture & Design

Monal Daxini presents a blueprint for streaming data architectures and a review of desirable features of a streaming engine. He also talks about streaming application patterns and anti-patterns, and use cases and concrete examples using Apache Flink.

Featured in AI, ML & Data Engineering

Joy Gao talks about how database streaming is essential to WePay's infrastructure and the many functions that database streaming serves. She provides information on how the database streaming infrastructure was created & managed so that others can leverage their work to develop their own database streaming solutions. She goes over challenges faced with streaming peer-to-peer distributed databases.

PouchDB – a CouchDB-inspired Offline Web Database

Inspired by Apache CouchDB, PouchDB (Portable CouchDB) is a small footprint database for web and especially mobile applications that need a browser-based storage solution that can be used offline. The database can be synchronized with CouchDB databases or other PouchDBs when the device comes back online.

PouchDB is actually a JavaScript library, 131KB in size in compressed form, that currently can perform the following set of basic tasks: create/query/replicate/delete a database, create/fetch/update/delete document(s), retrieving database information and listening to database changes.

The database also comes with an HTTP RESTful adapter that can be used to synchronize its content with other CouchDB/PouchDB databases.

PouchDB uses the HTML5 IndexedDB API to access the underlying storage engine used by the browser, SQLite in Firefox and LevelDB in Chrome. Work is in progress to support Web SQL, Local Storage and node.js. Unfortunately, Web SQL has been deprecated by W3C, but PouchDB will still support it because “mobile browsers support for IndexedDB is lagging far behind Web SQL”, according to Dale Harvey, the creator of PouchDB.

When we asked what are possible scenarios where PouchDB becomes useful, Harvey said:

Any web application (mobile of otherwise) that is required to work offline (which I believe most of them should). Any application that works offline as well as 'in the cloud' is going to have to deal with the issues of syncing data reliably, and so I think could potentially use PouchDB. The obvious examples are things like To-do lists / data management type apps.

Comparing PouchDB with a CouchDB offline installation, Harvey added:

CouchDB works great on the server, however it is obviously impossible to work with in an offline web application. PouchDB is a tiny embeddable CouchDB that can work in the browser and talk to your much more fully featured CouchDB when it is online.

PouchDB is currently in alpha and has been tested with Firefox +12 and Google 19+. It is likely work with all the browsers that implement the IndexedDB API. The code is available on GitHub under an Apache 2.0 license.