RxStorage PouchDB

The PouchDB RxStorage is based on the PouchDB database. It is the most battle proven RxStorage and has a big ecosystem of adapters. PouchDB does a lot of overhead to enable CouchDB replication which makes the PouchDB RxStorage one of the slowest.


The PouchDB RxStorage is deprecated and should no longer be used in new projects.


  • Most battle proven RxStorage
  • Supports replication with a CouchDB endpoint
  • Support storing attachments
  • Big ecosystem of adapters


  • Big bundle size
  • Slow performance because of revision handling overhead


import { createRxDatabase } from 'rxdb';
import { getRxStoragePouch, addPouchPlugin } from 'rxdb/plugins/pouchdb';


const db = await createRxDatabase({
    name: 'exampledb',
    storage: getRxStoragePouch(
             * other pouchdb specific options
             * @link https://pouchdb.com/api.html#create_database

Polyfill the global variable

When you use RxDB with angular or other webpack based frameworks, you might get the error Uncaught ReferenceError: global is not defined. This is because pouchdb assumes a nodejs-specific global variable that is not added to browser runtimes by some bundlers. You have to add them by your own, like we do here.

(window as any).global = window;
(window as any).process = {
    env: { DEBUG: undefined },


PouchDB has many adapters for all JavaScript runtimes.

Using the internal PouchDB Database

For custom operations, you can access the internal PouchDB database. This is dangerous because you might do changes that are not compatible with RxDB. Only use this when there is no way to achieve your goals via the RxDB API.

import {
} from 'rxdb/plugins/pouchdb';

const pouch = getPouchDBOfRxCollection(myRxCollection);

results matching ""

    No results matching ""