News for hackers. Stuff that matters.
Re:Why I'm So Happy About MongoDB by Vitaly on Tuesday December 13, 2011 @08:48PM (#3350231)
one of the tricks you can use is migrate on read. instead of having a global per-db versioning you have schema versioning on a per-record basis.

each version migration is a function that takes a record in an old state a migrates it to a new one.

once you read a record from the db that has an outdated version number you run all the pending migrations and then save.

with this scheme your application code only has to know how to deal with the latest schema version. all the rest is handled by migrations.

There are no comments on this comment yet.