Why riak might not be the DB for you

Riak at a first glance seems like a down from the heavens database of the future. Highly available, easily scalable and completely fault tolerant. We had used riak for a semi relational(our biggest mistake) application and these are a few problems we faced.

– Riak isnt your ordinary database its a key value store, its extremely hard to even write a simple user management system using riak. For example  searching is possible only based on the primary key of the bucket.

– Riak kept crashing for no apparent reason with logs showing nothing at all. With the app in staging the database kept crashing quite often with a CPU usage of 100%. We had hosted it on a 12GB machine, hence resources wasn’t  the problem.

– Although the instructions for creating a cluster of nodes was easy, adding new nodes to the cluster once the clusters had some data was almost impossible. The data did not replicate properly and the nodes kept crashing.

– Riak had a interface for indexing and searching the index using a solr like interface. One of our critical feature was relying on this. The search was returning the right result on the development and staging machines.  The Riak setup on the beta machine had a mind of its own, it never returned the right results

– Riaks logging system is horribly bad. Example debug message: {:fun => pre_commit}. Some one tell me which language is this?

 

The mistake we made

We cannot blame riak completely for our failure. We made this huge mistake of using riak as a relational database. It probably would have been ideal where there was huge amounts of data involved and queries involving map reduced where needed.

 

Conclusion

What you need to consider this isnt a rant on raik(May be except from the crashes and the logging), there are so much praise for riak out there, one mud sling will not change that. What the message for you from this is that, be completely aware why you would want to use riak in your application. Rather then trying to use a hip new database.

After weeks of sleepless night we finally moved to a different database(name not given to prevent controversy) and we  have not missed our sleep for the past few weeks.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s