Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use CouchDB as backend database to a MeteorJS app, instead of the default MongoDB?

Really would like to use CouchDB, and maybe make the Meteor app get data updates via Meteor Publish and Subscribe. But can't seem to figure out how to connect the Meteor app with CouchDB instead of the default MongoDB. Please help.

like image 434
Anup Bishnoi Avatar asked May 28 '12 18:05

Anup Bishnoi


People also ask

What is difference between CouchDB vs MongoDB?

CouchDB accepts queries via a RESTful HTTP API, while MongoDB uses its own query language. CouchDB prioritizes availability, while MongoDB prioritizes consistency. MongoDB has a much larger user base than CouchDB, making it easier to find support and hire employees for this database solution.

Why should you use CouchDB?

CouchDB supports both horizontal partitioning and replication to create an easily managed solution for balancing both read and write loads during a database deployment.


2 Answers

Now you can use CouchDb with Meteor as a drop in replacement for MongoDB. The guys at Cloudant have create Couchdb integration from Meteor.

Best thing is that its API resembles to that on Mongo in Meteor. Here is the package and details : https://github.com/cloudant/meteor-couchdb/

Enjoy :)

like image 159
praneybehl Avatar answered Nov 15 '22 21:11

praneybehl


Especially as this (Meteor+CouchDB) seems to be increasingly not happening, PouchDB is the best nearest alternative that I've found, and so I plan to start with it.

PouchDB notables I find:

  1. ability to sync with the 2 major CouchDB hosts, with nice intro by (my favorite) Cloudant, plus your own hosting per http://pouchdb.com/faq.html
  2. very cross-platform, as compared to Meteor, also has nice compatability breakdowns plus supports Safari Desktop plus:
  3. its client emulation of the server database feels stronger and further along than Meteror indeed PouchDB can be its own server (running on Node),
  4. it has an impressive list of powerful external projects including plugins -take a peek, including:
    1. "Peer Pouch" (p2p --doubt Meteor can do that)
    2. Full-text and spacial search
    3. Lacks Meteor's impressive authentication (including Meetup accounts!), but basic authentication seems there and already strong with CouchDB (per https://github.com/nolanlawson/pouchdb-authentication ), and that mentions impressive authentication coming: http://en.wikipedia.org/wiki/Mozilla_Persona support.
    4. Lack's Meteor's live (self-updating) templates but from the plugins, has 3 "MV* Adapters" including similar and terribly popular AngularJS.
  5. Performance-wise it seems to mostly beat leading competitor Couchbase Lite
like image 36
Destiny Architect Avatar answered Nov 15 '22 21:11

Destiny Architect