Edit (9/1/10): this benchmark is old, silly, and should probably be ignored in favor of more recent and representative ones. I don’t want to take it down for historical purposes, but seriously people, it was never a good benchmark, it’s over a year old at this point, and both databases have changed a lot.
Edit (12/6/09): this is the #1 Google result for “mongodb benchmark”, so I figure I’ll do some community service: if you’re interested in benchmarks, you might want to look at the 3rd party ones listed on the mongodb.org website.
Felix Geisendörfer did a benchmark in PHP that was super-easy for me to port into MongoDB. You can see his post on his blog.
And now… comparing his results for CouchDB with mine for MongoDB’s (I did the graph in Open Office, which is why the quality sucks):
As you can see, MongoDB does, uh, slightly better. Here are the numbers:
|# of Inserts||Couch Total Time (sec)||Couch Time/Doc (ms)||Mongo Total Time (sec)||Mongo Time/Doc (ms)|
Please let me know if I made any mistakes, all the values were hand-copied.
I ran these tests using the PHP driver on Ubuntu 9.04 on my MacBook Pro. You can see the test script I forked on Github.
A little analysis: Both DBs start with some overhead, but by 1000 inserts CouchDB seems to be chugging along nicely. MongoDB takes slightly longer to hit its groove, hitting its peak around 10000. They both slow a little near the end, as MongoDB starts spending most of its time allocating files and, although I know almost nothing about CouchDB’s structure, I’d guess it’s doing something similar.