Why CouchDB Rocks

Last week I wrote an article called Why CouchDB Sucks, which many people correctly said should have been called "What CouchDB Sucks at Doing". Nearly everyone pointed out that it was not designed to do the things that I was mentioning in the article. This time around, I'd like to focus on some of the features about CouchDB that I think absolutely rock.

CouchDB is schema-free

One of the most annoying parts of dealing with a traditional SQL database is that you invariably need to change your schemata. This can be done usually with some ALTER TABLE statements, but other times it requires scripts and careful use of transactions, etc. In CouchDB, the solution is to just start using your new schema. No migration needed. If it's a significant change, then you might need to change your views slightly, but nothing as annoying as what would be needed with SQL.

The other advantage of having no schema is that some types of data just aren't well suited to having a strict schema enforced upon them. My CouchDB-based lifestreaming application is a perfect example of the inherent flexibility of CouchDB's schemaless design is that all kinds of disparate information can be stored alongside each other and sorted and aggregated. There's also no reason that you need to use its schema-free nature this way. You could, for example, manually enforce a schema for certain databases, if needed.

CouchDB is RESTFUL HTTP

When is the last time you tried to install MySQL or PostgreSQL drivers for your web development platform of choice? If you're using apt-get it's not so bad, but for just about every other platform, it's a total pain to get these drivers up and running. With CouchDB, there's no need. It speaks HTTP. Want to create a new database? Send an HTTP PUT request. Want to retrieve a document from the database? Send an HTTP GET. Want to delete a database? Send an HTTP DELETE. As you can see, the API is quite straightforward and if a client library doesn't already exist for your language of choice (hint: it does), then it will take you only a few minutes to write one.

But the best part about this is that we already have so many amazing and well-tested tools to deal with HTTP. For example, let's say you want to store one database on one server and another database on another server? It's as simple as setting up nginx or perlbal or varnish as a reverse proxy and having each URL go to a different machine. The same thing goes for transparent caching, etc. Oh, and also, web browsers know how to speak HTTP, too. You could easily write whole web apps served only from CouchDB.

Map/Reduce

Map/Reduce will kill every traditional data warehousing vendor in the market. Those who adapt to it as a design/deployment pattern will survive, the rest won't.

Sounds like someone from Google must have said this, or some Hadoop evangelist, or maybe someone who works on CouchDB. In fact, this comes from Brian Aker, a MySQL hacker who was Director of Architecture at MySQL AB and is now developing the open source fork of MySQL named Drizzle (also a very exciting project in its own right). He's right, too. Google was on to something in a big way when they unveiled their whitepaper on Map/Reduce. It's not the be-all end-all for processing and generating large data sets, but it certainly is a proven technology for that task.

Brian talks about massively multi-core machines which seem the inevitability these days, and we will need to start writing logic that is massively parallelizable to take advantage of these masses of CPUs. Map/Reduce is one way to force ourselves to write logic that can be parallelized. It is a good choice for any new database system to adopt for this reason, and that's why it's great to see that CouchDB has adopted it. It's just one more reason why CouchDB rocks.

So much more

I could talk about how it can handle 2,500 concurrent requests in 10mb of resident memory usage. I could talk about its pluggable view server backends, so that instead of writing views in JavaScript you can write them in Python or any other language (given the correct bindings). I could talk about CouchDBX, which makes installing it on the Mac, quite literally, one click. I could even talk about how it's written in Erlang, with an eye towards scalability. Or maybe about how its database store is append-only.

I could talk about any of those things, and more. It just comes down to this: CouchDB rocks. But don't take my word for it--try it out for yourself!

48 Comments So Far...

By Andreas at 6:44 p.m. on Nov. 29, 2008

We should put native couchdb support for models in django on the 1.2 feature list.

 

By Chris McDonough at 8:31 p.m. on Nov. 29, 2008

It seems that ZODB has been doing much of this for ten years with ACID support. Is it that much better due to extra value at the edges, or what? I've not used CouchDB; I think it'd be great if someone knowledgeable compared the two.

 

By Eric Florenzano at 8:34 p.m. on Nov. 29, 2008

I'd absolutely love to see a comparison of the two technologies as well. I've simply never used ZODB so I can't speak to it. I've heard FUD about it, but won't what I've heard out of ignorance.

 

By Dan sickles at 1:30 a.m. on Nov. 30, 2008

I belive that ZODB is python specific. One of the key points of CouchDB is that unlike most object databases, it's not tied to any language. If you can talk http, you can talk to CouchDB.

 

By Chris McDonough at 7:51 a.m. on Nov. 30, 2008

Yep, having an HTTP interface is useful for that.

I've started trying to compare the two technologies by speculatively creating (read: messing around with, I don't really know if I'll finish it) a REST HTTP interface to ZODB via http://svn.repoze.org/repoze.loveseat/trunk/ . So far all I have is the database creation API done, but it seems like a fairly straightforward job save for the replication stuff.

 

By gareth at 11:11 a.m. on Nov. 30, 2008

It's too difficult to install CouchDB on Windows right now. It would be wonderful to have a 1-click installer for Windows.

 

By Jan Lehnardt at 11:48 a.m. on Nov. 30, 2008

 

By Jan Lehnardt at 11:49 a.m. on Nov. 30, 2008

> I could talk about how it can handle 10,000 concurrent requests in 10mb

That were 2,500 concurrent requests :)

 

By Eric Florenzano at 1:15 p.m. on Nov. 30, 2008

Whoops, that was supposed to be 1000, as per jchris's article! But 2500 is even better. Correcting now.

 

By Lars at 12:09 p.m. on Nov. 30, 2008

Oooh, you poor boy. You got scared because you can't have an opinion and stand by it when others criticize you? BE A MAN!

 

By Jesse Farmer at 1:07 p.m. on Nov. 30, 2008

Actually, it's a good traffic tactic. You get traffic from your first strident, possibly incorrect article, and you get more traffic from your "mea culpa" follow-up.

 

By Eric Florenzano at 1:18 p.m. on Nov. 30, 2008

The plan was always to do two articles. The first one would focus on things that it just wasn't designed to do, and the second would focus on why it rocks at what it does do.

I stand by everything that I said in that article alongside everything I say in this article.

 

By Teilo at 11:24 p.m. on Dec. 1, 2008

Oooh, you poor jerk. You got confused because you can't read very well, and hit "Submit Comment" before before your brain caught up with your nuts. BE A MENSCH!

 

By Joon at 4:19 a.m. on Dec. 19, 2008

Hello folks!

Is CouchDB appropriate for document management systems?

 

By PrufareCrarve at 12:41 p.m. on Dec. 19, 2008

Qualitative resource

 

By log splitter sale at 1:44 a.m. on March 6, 2009

One of the most annoying parts of dealing with a traditional SQL database is that you invariably need to change your schemata. This can be done usually with some ALTER TABLE statements, but other times it requires scripts and careful use of transactions, etc. In CouchDB, the solution is to just start using your new schema. No migration needed. If it's a significant change, then you might need to change your views slightly, but nothing as annoying as what would be needed with SQL. I totally agree.

 

By nendyGoarcace at 7:26 a.m. on April 17, 2009

nice, really nice!

 

By Gizmo at 9:18 p.m. on April 20, 2009

Some friends of mine have recommended me to try CouchDB. Will try it for sure after reading this post.

 

By dead sea salt at 7:44 p.m. on April 24, 2009

Oh man..you scared me...lol

 

By car insurance at 6:17 a.m. on April 26, 2009

Qualitative resource to be in.

 

By BigTime QuickBooks Timesheet at 2:50 p.m. on May 1, 2009

I have few questions:
Where will the data be stored?
How secured the database will be?
How can we access the data, javascript?

Thanks in advance
P.S.: On my way to read about Drizzle

 

By wholesale jewelry at 11:07 p.m. on May 7, 2009

Good site,it is so useful and helpful.
thks alot/

 

By korean jewelry at 10:12 p.m. on May 15, 2009

<A href="http://www.china-jewelry-market.com"> Jewelry Market</A>
<A href="http://www.korean-jewelry.com">Korean Jewelry </A>

 

By women's golf gloves at 10:39 a.m. on May 16, 2009

thanks for the info. cheers!

 

By wholesale lingerie at 2:15 a.m. on May 18, 2009

The plan was always to do two articles. The first one would focus on things that it just wasn't designed to do, and the second would focus on why it rocks at what it does do.

 

By china fashion jewelry at 2:41 a.m. on May 21, 2009

supply a wide range kinds of styles fashion jewelry

 

By Pereira at 1:26 p.m. on May 21, 2009

Hi, a try http://www.brunomlopes.com/software/couch-db-binaries? but I cannot create a document... badarg with and without auto-ID.
Anyone know why?

 

By ben10 oyunları at 2:59 a.m. on May 25, 2009

Whoops, that was supposed to be 1000, as per jchris's article! But 2500 is even better. Correcting now.

 

By wholesale jewelry at 3:30 a.m. on May 29, 2009

great infomation, thanks for sharing

 

By wholesale Lingerie at 6:30 a.m. on May 31, 2009

This can be done usually with some ALTER TABLE statements, but other times it requires scripts and careful use of transactions, etc. In CouchDB, the solution is to just start using your new schema. No migration needed. If it's a significant change, then you might need to change your views slightly, but nothing as annoying as what would be needed with SQL. I totally agree.

 

By starbuck Bowney at 1:20 p.m. on June 8, 2009

thanks for the infos, well done.

 

By make worm farm at 6:01 a.m. on June 12, 2009

Thank yxou for this great site! love the style!

 

By WoW Gold at 4:24 a.m. on June 13, 2009

Thx for sharing the exciting info with us.

 

By lingerie wholesale at 5:59 a.m. on June 14, 2009

is to just start using your new schema. No migration needed. If it's a significant change, then you might need to change your views slightly, but nothing as annoying as what would be needed with SQL.

 

By free high school diploma at 2 a.m. on June 17, 2009

Correcting now.

 

By free high school diploma online at 2 a.m. on June 17, 2009

thanks for sharing

 

By life experience degree at 2:01 a.m. on June 17, 2009

Thank yxou for this great site

 

By life experience degrees at 2:01 a.m. on June 17, 2009

great infomation

 

By oyUn at 6:37 p.m. on June 17, 2009

Whoops, that was supposed to be 1000, as per jchris's article! But 2500 is even better. Correcting now.

 

By jordan shoes at 12:25 a.m. on June 20, 2009

good, thanks for your hard job!

 

By ugg boots at 12:26 a.m. on June 20, 2009

awesome! i like your bolg so much!

 

By nike shoes at 12:27 a.m. on June 20, 2009

thank you so much for your sharing.

 

By jordan shoes at 12:28 a.m. on June 20, 2009

you are really something!

 

By wholesale jewelry at 5:17 a.m. on June 30, 2009

good infomation

 

By lv handbahgs at 3:38 a.m. on July 2, 2009

 

By handbags at 3:40 a.m. on July 2, 2009

http://www.fantastic-replica.net
Replica Louis vuitton handbags
fake Louis vuitton
Louis vuitton knockoffs
designer bags
louis vuitton bags
louis vuitton purse
coach bags
wholesale replica handbags

 

By Stop Dreaming Start Action at 7:07 a.m. on July 2, 2009

Got to agree here, info is pretty daymn good. This was just what I was looking for, great resource. Bookmarked

 

By Rusli Zainal Sang Visioner at 7:07 a.m. on July 2, 2009

Thanks for sharing your thought. Wish you good

 

Voice your opinion...