design patterns - Application upgrade in a high availability environment -


i writing nosql database engine , want provide features developers upgrade application new version without stopping operation of website, i.e 0% downtime during upgrade. question is, methods or general design of web application when run 24/7 , changing database structure often? examples or success stories appreciated.

with nosql - , document oriented database - can accomplish versioning.

consider mongodb, stores documents.

mongodb allows have collection (a group of documents) schema every document can different.

let's have document user:

{ "_id" : 100, "firstname" : "john", "lastname" : "smith" }

you have document in same collection:

{ "_id" : 123, "firstname" : "john", "lastname" : "smith", "hasfoo" : false }

different schemas, both in same collection. different traditional relational database.

the solution add field every document has schema version. have application version every query.

a mongodb query might this:

users.find({ "version" : 3 }).limit(10);

that returns users using schema version "3". can insert newer schemas without affecting existing site , delete old schema versions aren't useful anymore.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -