DEV Community

Discussion on: CouchDB, The Open-Source Cloud Firestore Alternative?

ekoopmans profile image
Erik Koopmans

Hi, great article! You mention you haven't dived into security and rights yet - I'll warn you and any others that might be interested in CouchDB that this is where the technology is lacking. There is no per-document rights, only per-DB.

A common recommendation around this is to use many (think thousands) of DBs, i.e. DB-per-user, and set up filtered replications to maintain each user's access. Unfortunately this has very poor performance - I found that for a small project (~150 users with a few admin roles) the CPU usage for replication became unwieldy.

CouchDB's cousin, Couchbase, does a much better job of security and rights, though has its own quirks. It requires a secondary layer (called Sync Gateway) to give it a Couch-like API which can connect to PouchDB. This also provides a very useful "sync function" that allows very smooth per-document rights. I'm mostly happy with it. I don't think CouchDB is viable for any project with anything but the most basic rights setup.

I've actually just followed the reverse of your journey, starting with CouchDB and ultimately landing on Firebase as the way to go! One of my main regrets though is the loss of document versioning, which I think is incredibly valuable in CouchDB and Couchbase. That and losing direct control over the data and where it's stored.

juliendemangeon profile image
Demangeon Julien Author

Thanks for your feedback ! I'll take a look at Couchbase soon. I even don't known that they're so different.