Search code examples
rubyactiverecordmongodbruby-on-rails-3.1scaffolding

Rails 3.1 and MongoDB - ActiveRecords?


I try to use first time MongoDB instead of MySQL in my Rails 3.1 app and I am a bit confuse about the rules around.

I know MongoDB is NoSQL and document database and stuffs like that. But what I would like to ask, is - I am accustomed from a work with MySQL with an associations between tables and scaffold generating and migrations.

Is it possible to use here with a work in MongoDB? I try to find a good tutorial for this on Google, but I still can't find the good source about it...

Have anyone any good a tip around this things?

Many thanks in advance.


Solution

  • ActiveRecord won't work with MongoDB. You need another library.

    I recommend Mongoid. It's good, documentation is excellent. Check it out. It installs its own generators, so you can scaffold away. Oh, and you don't need migrations with MongoDB.

    I also heard good things about MongoMapper.