Exploiting MongoDB's Dynamic Schema Nature in Rails

Kareem Kouddos

May 23, 2012

One of the most awesome benefits of Mongo is that its a dynamic schema. This means you can do some really interesting things in your models such as dynamically adding attributes to the model without requiring a migration. The simplest example is adding createdat or updatedat timestamps. We'll go over some cool examples and discuss best practices. We'll cover best practices to avoid downtime in production while migrating to a different data representation.