views:

478

answers:

2

I think these three are the most popular non-relational db:s out there at this moment.

I want to give them a try, but I wonder which one of these are most suitable for Rails when it comes to Gem, documentation and tutorial support.

Eg. if I install a very good gem that is for Rails but this just use AR and mongodb, then it would be a pity I didn't use mongodb.

  • How many gems are supporting each one of these databases?

  • Which one is the most popular and main-stream in ruby/rails community, thus has more online documentations/tutorials?

  • Which one offers tight integration of Rails?

+4  A: 

I personally used "mongoid" recently and it was working really good. One thing to keep in mind is that they are more active in Rails 3.0 branch so not all features listed on their website work in Rails 2.x (for example references). I also tried to use "Devise/Warden" for authentication and it worked seamlessly in Rails 3.0 but did not have support for Rails 2.x + mongoid (although mongomapper was supported)

Zepplock
Great that Devise works with Mongodb! Do you know if it supports the other 2?
never_had_a_name
Here's what supported in master (Rails 3.x): http://github.com/plataformatec/devise/tree/master/lib/devise/orm/ and here's what in 1.0.x (Rails 2.x): http://github.com/plataformatec/devise/tree/v1.0/lib/devise/orm
Zepplock
@zepplock: seems to me that mongodb is the most popular for ruby and rails. that is correct for other gems too you think?
never_had_a_name
Unfortunately I can not comment on "popularity" since I don't have enough experience. I mostly use mysql but I tried mongodb in one project and chose mongoid over mongomapper. Personally I'll be giving mongoid more effort once Rails 3.0 is out and stable for production.
Zepplock
+4  A: 

To make an informed selection, you'll really need to know your data model. MongoDB and CouchDB are document-oriented data stores. Cassandra is quite different, it is a bit more special-purpose and its distributed design is its strength. It's more of a distributed key/value store but with slicing, timestamp sorting, range queries, with limited data types. If you had a huge amount of data and knew exactly how it needed to be indexed for retrieval, Cassandra might work. Mongo and Couch are better for ad-hoc queries, and for example an AR replacement for a Rails app.

As far as popularity, I'd say MongoDB is currently more popular with Rubyists, but in general CouchDB seems to have more mindshare and a lot of momentum.

See also http://nosql-database.org/ for more information on the differences.

Mark Thomas