As a web and mobile application developer, you may come to a point where you need to worry about data and how to synchronize it between devices in platforms. PouchDB is one of a few good solutions that makes this task significantly easier. In this episode of The Polyglot Developer Podcast, guest speaker Nolan Lawson and I discuss PouchDB and how it is being used in a lot of modern applications, both web and mobile.
Nolan Lawson is a Program Manager at Microsoft, but also one of the core contributors to the PouchDB open source project. In Episode #6: PouchDB and its Usefulness in Browser Based Development, we’re going to cover a lot of ground without actually showing how to use the database in your application. After all, this is an audio only podcast. You will however, be educated on a lot of the technical concepts and popular use cases behind the tool.
For those of you that would rather read than listen, I’m going to explain some of the podcast episode here.
PouchDB is a wrapper library for all the popular web based storage technologies such as, but not limited to, WebSQL, IndexDB, and local storage. It will essentially choose what storage technology is best for the platform that you’re using to maximize compatibility.
PouchDB allows you to not only store data locally, but also synchronize it to a remote data source when able to. Supported remote data sources include CouchDB, Couchbase, PouchDB Server and IBM Cloudant.
By default PouchDB uses a form of long-polling to perform synchronization between remote database and local device, but this can be changed to use sockets instead. However, Nolan recommends the default method for most scenarios.
Per Nolan, PouchDB is used with browser based applications, and Node.js, but most frequently is used with hybrid mobile applications built with Apache Cordova. These include PhoneGap and Ionic Framework. Nolan said that although not directly supported by the PouchDB team, there are also extensions that will make it compatible with frameworks like React Native and NativeScript.
I brought up the topic of TypeScript and type definitions. There are type definitions on DefinitelyTyped that are a bit out of date, but work will be done in the future to make them a core part of the library. This is because frameworks like Angular 2 and Ionic 2 put a much stronger emphasis on TypeScript than frameworks previously did.
Nolan brought up a cool story on the podcast regarding how people in West Africa were using a mobile application that included PouchDB to track the Ebola epidemic. Since internet connections are sparse in West Africa, the data was collected and synchronized remotely as internet became available.
Below is a video presentation from a conference where the Ebola application was discussed.
Trust me when I say this, but the material in the podcast is much better than the summary I included in these show notes. Our discussion is technical on everything PouchDB. If you ever wanted to know how it works or why you should use it in your mobile or web application, listen to the episode.
As of about a week ago, PouchDB 5.4.0 was released which contains the ability to craft custom builds. This is great for developers trying to reduce the overall application size.
If you have questions regarding this podcast episode, you can fill out the form here and either Nolan or myself will get back to you. If you’re listening to this podcast via a service or application and it allows you to leave a rating or review, please give it a positive rating.
Stay up to date on the latest in web, mobile, and game development, plus receive exclusive content by subscribing to The Polyglot Developer newsletter.