What's the cases of CouchDB?

I’ve rad here Wappler 6: Unleashing the Power of CouchDB and PouchDB Integration for Low-Code Development and CouchDB and PouchDB Integration in Wappler about CouchDB.

I get the idea behind PouchDB - when use is offline, he still can update data on he’s side and when he’s online - data is synced with CouchDB.

But overall - what’s the idea behind the CouchDB and what’s real use case?
In example shown here - CouchDB and PouchDB Integration in Wappler - I can do same easily by using Sockets and when upon new data event - push new GetData. I mean - it looks easily with CouchDB, but doable within our current “technology stack in Wappler 5”.

Can you please describe real world use case of CouchDB when you already have PostgreSQL + Data update with Socket Refresh?

Essentially, PouchDB is a CouchDB database that can be installed locally on a device. So, rather than sitting on a server somewhere “in the cloud”, the database is on the user’s device itself.

You can run a PouchDB database in complete isolation. If all you are interested in is local data storage, but the requirements of your application would benefit from the functionality that CouchDB provides, you can just install PouchDB and use it locally.

However, any database that uses the CouchDB protocol can be easily synced to any other database that uses the same protocol, so 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.

Source: CouchDB, PouchDB, and Ionic 2: Why PouchDB? | Josh Morony

1 Like

I have just one huge app which is heavily based on all aspects of MySQL, and that isn’t going to change…

…but I’d love to develop a mobile version which works offline.

Can CouchDB sync with MySQL in some way, or is this new feature just not for me? :thinking:

As you have the same server connect database actions for CouchDB as for MySQL you can just copy data from one database to other with server actions as you wish. And when new data comes to CouchDB it will be automatically replicated to all clients

2 Likes

I plan on using this for a mobile app (or more likely a PWA) with a project I’ve already built in PHP/MySQL. Would the way to go be to create the new PWA in Node using CouchDB and copy the MySQL data to it like you suggested to @Antony? And obviously copy it the other way, too, so it’s fully synced?