I'm wondering if anyone has tried the get couch-connector to work with multiple databases.
I have couchapp which uses multiple databases and I'm having trouble with couch-connector to work with it. Couch-connector works great when I'm using one database, but if I try to fetch a collection from another database view I have problem, because it uses my main design document in url.
One more question: what's the best practice for implementing a chat app in my project. Is it better to have one database as inbox or should I make databases for every user. Im concered for scallability of app in case of one inbox database.
couch_connector isn't really built to do more than a single database. You might checkout backbone.couchdb.js if you're not too far along in your project. It supports multiple databases via code like:
var main_db = Backbone.couch.db('main');
var other_db = Backbone.couch.db('other');
You can see some sample code (albeit with a single DB) in the readme-backbone.js app I'm building at Couchbase.
Hopefully the two libraries are similar enough that porting your code won't be hard.
For your inbox question: The first concern is actually your MapReduce Views--they only deal with the documents in a single database. If you'll be using a View to access data based on channels, dates, users, etc, then you'll need all the documents within a single database. However, you could split the database on something "bigger" than per-user (like per-channel).
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With