Optimizing your CouchDB Calls by 99% (no strings attached)
blog.cloudant.com
blog.cloudant.com
Don't use CouchRest::Database! because it tries to create the DB each time. (Use CouchRest::Database instead)
Don't let multi_json pick the json library! Pick jsonx yourself before couchrest runs.
Don't use HTTPS for internal connections.
For the last 3%... He hacked in a binary format into couchrest and couchdb in 10 lines of code.
While the HTTP-only protocol work up until now has been one the nice "Ease of use" standout features for Couch, it also leads to a lot of overhead when you know you absolutely don't benefit from it.
All the work on CouchApps (only CouchDB + JavaScript apps) makes a lot of sense to have the rest-only interaction, but if you are trying to scale out a high read/write couch install and are already using tricks like TCP no_delay and server-side batching along with batch-doc operations on the client there is only so much you can do before you slam up against what looks to be a 6-10K docs/sec change rate due in no small part to Couch (even with its new JSON parser) processing data structures into and out of textual JSON.
HTTP is baked pretty deep into CouchDB, which makes it hard to remove (but who knows, Couchbase seems to be having some success ripping it out). BigCouch (Cloudant’s distributed version of CouchDB) has the HTTP layer neatly separated through the Fabric library (https://github.com/cloudant/fabric), so it'd probably be easier to add a binary protocol there.
Keeping the HTTP protocol in this case is fine for me and not require any unexpected changes to Couch. I hope that binary format work can be make configurable in the future with other formats supported.
Thanks for the clarifications Tim.
I don't use Ruby, so I'm not sure how much of the talk would apply to me, but we use CouchDB extensively at work.
There are 2 or 3 nebulous "replication breaks" bugs that are filed from older versions, but one that says it is still happening on 1.1.1 with no followups from the team.
Filipe I believe rewrote the replication code from scratch for 1.2 so again, it is hard to know if the replication hickups are non-issues or not so I'm curious if you have real world data points here.
Is this work going to go into Couchbase 2.0 builds? (not necessarily the current preview, but the final GA release?)
I realize he has just grievances against multi-json and couch-rest, but really that kind of attitude drags the whole community down.
OSS should be about collaboration, not a dick swinging contest.
Seriously though. The poor design (& egregious misuse) of those libraries became a major concern for us at Cloudant. I wanted people to become aware of what they were doing wrong & why. I thought it would be best done with a bang. Fixing the situation beyond the patches I submitted would have required that I go on a campaign to have those libraries removed from the face of the earth (which seems more extreme than very strongly recommending people stay away from them).