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

3

11

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.

Declaratory answered 28/5, 2012 at 18:6 Comment(0)
R
9

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 :)

Roxanneroxburgh answered 3/11, 2015 at 3:4 Comment(1)
Mongo API on a CouchDB does not seem like the BEST thing, but I can see some value in there, tooGruesome
R
8

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
Respecting answered 8/7, 2014 at 8:44 Comment(1)
Do also take a look at hood.ie. Couch-oriented and has many built-ins comp with Meteor.Fossiliferous
L
6

The Data section of the Meteor docs (last paragraph) mention substituting other DB engines for Mongo by writing a driver. Here's the quote:

You can substitute another database for MongoDB by providing a server-side database driver and/or a client-side cache that implements an alternative API. The mongo-livedata is a good starting point for such a project.

Logarithm answered 23/6, 2012 at 8:8 Comment(5)
What is this "mongo-livedata" thing? Where can I find more about it?Dextrad
Your initial link (to the data section of the meteor docs) has rotted.Apery
...AND the information that I quoted no longer appears, I can't vouch for any information I originally provided after the recent changes in Meteor.Logarithm
Agree. Quote's in web.archive.org/web/20120705173127/http://docs.meteor.com but after that,Archives empty; +just did Google Search(site:meteor.com (server-side database driver) OR (substitute another database)) but in results(2pgs) only found again docs.meteor.com/#dataandsecurity saying "support for other databases is coming in the future" + QUOTE-REPLACEMENT "Future releases will include support for other databases" BUT 0 MORE, except recently they (instead?)improving theirMongoDBsupport(w/ "sort"&"limit") meteor.com/blog/2014/03/18/meteor-072-scaling-realtime-mongodbRespecting
Also see hood.ie which is a little like meteor but backed with couch.Fossiliferous

© 2022 - 2024 — McMap. All rights reserved.