Random Thoughts on Cassandra, Riak and MongoDB

on
| 2 min read

A few days ago I was conducting some preliminary tests and benchmarks on a couple of NoSQL solutions such as Redis, Cassandra and Riak.

As expected, Redis performed really really well, its speed is unmatchable by Cassandra and Riak.

However, that’s not the point.

One thing I noticed is that quite a few people don’t really get what ’scalability’ actually means. In this case, Redis does not scale (yet), so comparing the raw performance (on a single machine) isn’t entirely useful.

Both Cassandra and Riak scale. They are key/value solutions designed from the ground up to support distributed computing. The primary reason I wanted to evaluate them, is for their distributed nature - adding/removing nodes without impacting the application means (near) real time, automated scalability.

Despite the fact that Cassandra is being used in high-profile sites such as Digg, Facebook and Twitter, it is still in its very early stage. It lacks good client library support, at least for Ruby.

Riak has better client library support for Ruby, unfortunately it did not perform well against Cassandra. On a single node, it is 3 to 5 times slower than Cassandra, and it even crashed a few times during higher concurrency tests.

Oh and by the way, for simple inserts and writes, MySQL (both MyISAM and InnoDB engines) actually performed better than Cassandra and Riak, but of course, as soon as you throw in a couple of joins, things start to look ugly.

Looks like I’ll be doing some MongoDB tests in the next few days. I’ve heard so many good things about it. The folks over at BoxedIce has a very good post on why they chose MongoDB to replace MySQL.

MongoDB has limited scalability via auto-sharding which is currently in alpha. Fortunately for me, I don’t need scalability right away.

To me, there are two clear advantages of using MongoDB. One, MongoMapper is a well thought library with good community support; two, unlike Cassandra and Riak, MongoDB supports advanced queries.

What are your thoughts? :)

Enjoy what you are reading? Sign up for a better experience on Persumi.

Comments