Lesson 5

Introduction to PouchDB

An introduction to the basics of PouchDB

PRO

Lesson Outline

Introduction to PouchDB

We've covered the basics of what CouchDB is and why we are going to be using it to build this application, but I've also mentioned another technology called PouchDB. In this lesson, we are going to cover what PouchDB is, why we would want to use it, and how it differs to CouchDB.

Essentially, PouchDB is a JavaScript implementation of a CouchDB database. Rather than sitting on a server somewhere "in the cloud", the database is on the user's device itself. PouchDB also provides a useful API that we can use to interact with the local database.

You can run a PouchDB database in complete isolation if you want to. If all you are interested in is local data storage, but the requirements of your application would benefit from a CouchDB style document database, you can just install PouchDB and use it locally. In this scenario, it would be similar to using Ionic's Storage API, just with a lot more functionality (Ionic's Storage API is more like a simple key-value NoSQL database, whereas PouchDB would provide us with a fully featured document based database).

Although PouchDB and CouchDB are two different things, any database that uses the CouchDB protocol can be easily synced to any other database that uses the same protocol.

We can easily sync a local PouchDB database to a remote CouchDB database. Syncing means that any changes made to the local PouchDB database will automatically be reflected in the remote CouchDB database, and any changes made to the remote CouchDB database will be reflected in the local PouchDB database. This isn't just limited to two databases either, you could have any number of local PouchDB databases synced to any number of remote CouchDB databases.

To summarise:

PRO

Thanks for checking out the preview of this lesson!

You do not have the appropriate membership to view the full lesson. If you would like full access to this module you can view membership options (or log in if you are already have an appropriate membership).