Why CouchDB Sucks

Eric Florenzano - - November 23, 2008

CouchDB really sucks at doing some things. That should come as no surprise, as every technology has its advantages and its drawbacks. The thing is, when a new technology comes out that looks really promising and cool, everyone writes about all of its advantages, and none of its drawbacks. Then, people start to use it for things it isn’t very good at, and they are disappointed. In that spirit, I would like to talk about some of the things that (in my experience) CouchDB is absolutely not good at, and that you shouldn’t try to use it for.

First, it doesn’t support transactions in the way that most people typically think about them. That means, enforcing uniqueness of one field across all documents is not safe. A classic example of this would be enforcing that a username is unique. You can check whether a username exists, and if not, create a new one. There is no guarantee, however, that between the time that your app has checked for its existence, and the time that you write the new user to the database, that some other instance of your app hasn’t beat you to that write.

Another consequence of CouchDB’s inability to support the typical notion of a transaction is that things like inc/decrementing a value and saving it back are also dangerous. Fortunately there aren’t many instances that you would want to simply inc/decrement some value where you couldn’t just store the individual documents separately and aggregate them with a view.

Secondly, CouchDB sucks at dealing with relational data. If your data makes a lot of sense to be in 3rd normal form, and you try to follow that form in CouchDB, you’re going to run into a lot of trouble. Yes, it’s probably possible with tricks with view collations, but you’re constantly going to be fighting with the system. If your data can be reformatted to be much more denormalized, then CouchDB will work fine.

Thirdly, CouchDB sucks at being a data warehouse. In every data warehouse that I’ve ever run into, people have all kinds of different requests for how to slice the data. And they all want it to be done, yesterday. The problem with this is that temporary views in CouchDB on large datasets are really slow, because it can’t use any of its normal indexing tricks. If you by some chance have a very rigid way of looking at your data, using CouchDB and permanent views could work quite well. But in 99% of cases, a Column-Oriented Database of some sort is a much better tool for the data warehousing job.

So does CouchDB suck? No, it’s by far my favorite new database technology on the block. What it’s good at doing, it’s great at doing, but that doesn’t mean that it should be used for everything. With the kinds of scaling issues that we’re seeing with today’s highly-interactive web applications, we need to make use of a broad range of technologies, and use each one for its greatest strengths. That’s called using the right tool for the job, and that’s never gone out of style.



Categories: Blogs  Eric Florenzano  

Comments

anonymous avatar

You have said how couchdb sucks at data warehousing but I also think we ought say how couchdb is great at data warehousing.

I saw a presentation where someone at craigslist.com is considering couchdb for data warehousing.

The beauty is that schemas change, and couchdb does not care.  It is better to get ALL the meta information of an object than static fields with a gazillion nulls in it.  chances are, you will actually find what the user is looking for.  In so far as data warehouses are real time, relational databases can still be employed to optimize couchdb searching as required without the requirement to store all the data on a relational db.

Thanks for a great article.

Jim

Posted by Jim Whitescarver on 05 May 2009 at 18:27



 
anonymous avatar

Let me add a word on transaction processing in couchbd.  In relational databases we are lulled into the delusion than our transactions succeed while an inconsistency may develop at any time in the future because our objects are always extended and in the state of becoming.  We ought to have a recovery for such occurrences.

In couchdb reliable transactions may be achieved by defining such recovery.  Transactual computing in general is interactive computing.  In the absents of a rule, e.g. choose a new user name, the originator/owners of conflicting data decide the issue independently, instantiating new rule alternatives, and thus dynamically extending the object behavior collectively.

Jim

Posted by Jim Whitescarver on 05 May 2009 at 18:55



 
anonymous avatar

Couchbd is good but does not have many features as it presents to you. Its quite difficult to use.

Business intelligent services

Posted by Tushar on 08 Jul 2010 at 12:45



 
anonymous avatar

Thanks for sharing your information.

Posted by Freelancer employment on 12 Jul 2010 at 15:24



 
anonymous avatar

Thanks for your experience.
Freelancer employment

Posted by Tushar on 12 Jul 2010 at 15:25



 
anonymous avatar

Best canon Coffee Mugs! Funny, Cute, & Humorous Unique designs. Also find Travel Mugs, Coffee Cups also, or Create Photo Personalized Mugs & Drinkware
canon mugs
canon lens mugs
Nikon Mugs
Canon Coffee Lens Mug
Nikon Coffee Lens Mug

Posted by dress on 08 Sep 2010 at 09:36



 
anonymous avatar

Tiffany Jewellery
Fashional Tiffany & CO. products about all Tiffany Jewellery, like: Tiffany Ring, Tiffany Necklaces, Tiffany Earrings, Tiffany Bracelets,
Tiffany Necklaces
Tiffany Charms
Tiffany Bracelets
Tiffany Earrings
Tiffany Rings
Tiffany
Tiffany and Co
tiffany jewellery from tiffany & co are now on sale on our uk store.

Posted by 3653197 on 11 Sep 2010 at 09:06



 


Add comment

Name:

Email:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?