16

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?

never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
  • 12
    Respectfully, I think this is the wrong starting point for deciding to use one of these applications. They have very different strengths and weaknesses and to a large extent it doesn't matter which has the best ruby/rails support if it's entirely wrong for what your application needs to accomplish. – Mike Buckbee Aug 23 '10 at 19:25
  • 3
    If you want popularity and tight integration, MySQL is 100x more popular in Rails deployments and easily the most tightly integrated. Drizzle will likely become a contender there too. If you are looking to learn, I would suggest trying several DBs until you find something that feels comfortable. – JasonSmith Aug 29 '10 at 07:45

2 Answers2

17

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
  • 37,131
  • 11
  • 74
  • 101
5

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
  • 28,655
  • 4
  • 35
  • 50
  • Great that Devise works with Mongodb! Do you know if it supports the other 2? – never_had_a_name Aug 23 '10 at 18:10
  • 1
    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 Aug 23 '10 at 18:20
  • 1
    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 Aug 23 '10 at 19:13
  • 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 Aug 23 '10 at 20:31