CouchDB document database with sync. Use for offline-first apps.
CouchDB is a database that completely embraces the web. It speaks JSON and HTTP. It is unique for its multi-master replication protocol, making it ideal for "Offline First" apps.
# Create a document via REST API
curl -X PUT http://admin:[email protected]:5984/my_database/doc1 \
-d '{"key": "value"}'
Documents are versioned (_rev). If you update a doc, you must provide the current _rev. If it has changed on server, you get a conflict (409).
Views are written in JavaScript functions (Map/Reduce).
Since replication is multi-master, conflicts happen. CouchDB keeps all conflicting revisions and lets the app execute logic to pick a winner.
Do:
Don't: