Open In App

PouchDB

Improve
Improve
Like Article
Like
Save
Share
Report

PouchDB is an open-source, NoSQL, in-line database. It is written in JavaScript and is basically a javascript implementation of CouchDB. 

It is modeled after CouchDB – a NoSQL database that powers npm. We can also create applications using PouchDB which can work offline and online and thus it saves data locally. PouchDB uses IndexedDB and WebSQL internally for data storage. 

How PouchDB work offline ? 
PouchDB works offline as well as online with the same efficiency. It works offline by storing the data locally and synchronizing it to the servers and CouchDB when online. It stores data locally using IndexedDB and WebSQL in the browser. 

You can also communicate with remote and local databases continuously using PouchDB without noticing any difference. 

Features of PouchDB : 

  1. Open Source – 
    It is available on GitHub and on other open source application. 
     
  2. Cross-Browser – 
    We can run PouchDB on various browsers as the API provided by it works the same in every environment. 
     
  3. Easy to learn and understand – 
    If you have some knowledge of programming language, PouchDB is very easy to learn and understand. 
     
  4. Lightweight – 
    We can easily include it using script tag as it has a light weight API. 
     

Advantages of PouchDB : 
 

  • There is no need to perform queries over network as PouchDB resides inside the browser and thus it makes it extremely faster. 
     
  • You can run apps both online and offline as you can synchronize the data with any of the supported server. 

Installing PouchDB : 
 

1.Download and Install Node.js and npm (Windows, Linux). 

 

2.Install PouchDB – Execute the following code on command prompt to install PouchDB. 
 

npm install pouchdb 

 

3.Install PouchDB Server – Execute the following code on command prompt to install PouchDB Server. 
 

npm install -g pouchdb-server 

4.Set a local Port number – Now set a port to run PouchDB: 
 

pouchdb-server -p 5984 

After this, let the pointer keep on blinking. 

 

5.Open PouchDB – Now visit the following address. 
 

http://127.0.0.1:5984/ 

Now, your PouchDB installation is successful.
 


Last Updated : 04 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads