PouchDB — Installation and Features

Fatih Yıldızlı
Kariyer.net Tech
Published in
3 min readOct 13, 2018
( Source: https://pouchdb.com)

PouchDB is an in-browser database that admits applications to save data locally.

PouchDB is an open-source JavaScript database. This database stokepiles documents in JSON format.

PouchDB acquiesces you to create, read, update, delete your document by Javascript API.

Browser Support:

PouchDB supports all modern browsers, using IndexedDB under the hood and falling back to WebSQL where IndexedDB isn’t supported.

PouchDB — the in-browser database

Storing data in a web application couldn’t be simpler. Get PouchDB into your web page’s code by whichever means you favor, and then write some JavaScript as below:

var db = new PouchDB('medium');
var doc = {
author: 'fatih',
post: 'pouchdb',
date: '2018-10-14',
verified: true
};
db.put(doc); // Create a new document

If you want to read all documents , you’ll write this js code.

db.allDocs();

Queries& Functionalities: lots more.

Web Browser view : Developer Tools →Application →IndexedDB →by-sequence

— Installation —

Client side :

Add in your index.html file.

<script src="//cdn.jsdelivr.net/npm/pouchdb@7.0.0/dist/pouchdb.min.js"></script>

Install PouchDB Server

Node.js

PouchDB — the HTTP server

If you want to pace PouchDB as if it were an Apache CouchDB service, with HTTP API, dashboard, and all, then you’re only a couple of commands away:

npm install -g pouchdb-server
pouchdb-server
npm install -g pouchdb-server
pouchdb-server

Set a local Port number

> pouchdb-server — port 5000

set a local port number

Then visit http://127.0.0.1:5000/_utils/ in your any browser to see this GUI.

Local Pouchdb server port 127.0.0.1:5000

Accessing PouchDB Server GUI

You can admittance “http://127.0.0.1:5000/_utils” to see the complete GUI of PouchDB.

Features

  • Cross-Browser
  • Lightweight
  • Easy to learn
  • Opensource

Advantages

  • PouchDB is extremelly fast because it inhabits inside the browser and there is no need to perform queries over the network.
  • PouchDB facilitates you to integrate the data with any of the supported server that’s why your app can run both online and offline.

Sources:

https://github.com/pouchdb/pouchdb-server

https://pouchdb.com/guides/

https://pouchdb.com/api.html

couchdb.apache.org

Thanks Erdogan Oksuz ;)

--

--