Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Cassandra production ready for Ruby on Rails?

I'm working on a project that is considering using Cassandra as a database. We would like to eventually migrate to Cassandra even if we use MySQL to start with, given its scalability. I know that big companies like Facebook, Digg, and recently Twitter is using Cassandra, but I don't believe any of those sites run off Rails. My question is whether or not it's feasible to use Cassandra using Ruby on Rails. Points to consider:

  1. We heavily rely on the Authlogic gem. Would switching to Cassandra affect how it works?
  2. Are there any mature ruby clients for Cassandra? Looking on Github it seems that fauna's client (now twitters's client) is the most mature. Has anyone had production experience with it?

Appreciate any tips.

like image 239
funkymunky Avatar asked Mar 04 '10 20:03

funkymunky


People also ask

What database does Ruby on Rails use?

Rails comes with built-in support for SQLite, which is a lightweight serverless database application. While a busy production environment may overload SQLite, it works well for development and testing. Rails defaults to using a SQLite database when creating a new project, but you can always change it later.


2 Answers

Twitter is running rails on most of their front end. Fauna's client is actually built and released by twitter, so you can be pretty certain that it's up to date and stable on large workloads. Looking at the history of commits shows that there are frequent improvements being pushed to it, which is great.

Most likely Authlogic would need to be customized to work properly with Cassandra. In particular, it appears to provide certain methods based on named_scope and relational data.

It does appear that someone has built a plugin for DataMapper support in Authlogic: http://twitter.com/collintmiller/statuses/2064046718. You may be able to use that as a starting point for making it compatible with Cassandra.

Good luck!

like image 95
Gdeglin Avatar answered Oct 05 '22 05:10

Gdeglin


I don't think starting with MySQL and then moving to Cassandra is a good idea.

Cassandra is a NoSQL solution, while MySQL is a "classic" SQL-driven database.

This means that your models would be different.

If you start with MySQL, you will have to rely on ActiveRecord for creating your models. If you then change to Cassandra, you will have to change all your models to a NoSQL-compatible middleware (such as BigRecord). This not only means changing your models, but also the controllers that use them (since their interface would be different).

This said, Cassandra and the like are supposed to be used on very demanding applications - like twitter.

The rest of web applications out there are orders of magnitude less intense - are you sure you still would need Cassandra?

PostgreSQL, and a well-designed database, is just good enough 98% of the time.

like image 22
kikito Avatar answered Oct 05 '22 04:10

kikito