Database Schema Refactoring and Migrations

1 - I can do better 2 - Jury's out 3 - Pretty darn good 4 - Splendiferous 5 - Awesometastic by 0 people | Log in to rate

Ranked #6,894 in Tech & Geek, #162,995 overall

A failed schema upgrade can ruin your day, week, or career

After developing an application upgrade with a partner site several states away, we were finally deploying.  And it wasn't going well.

The upgrade included several schema upgrades.  Those upgrades and the required data migration were scripted.  Good.  The development database schema didn't match the production schema.  Bad. Their answer?  "Run the script again and see if it works."  Bad, bad.  Two hours later, we had to roll back to the previous application.  They had backups.  Good.  They had no idea how to restore from their backups.  Oh... oh no, bad, bad, bad!

At that point I had been using ActiveRecord::Migrations for painless database upgrades for months, so i knew there was a better way, but a Ruby tool was a tough sell for this client.  Developers in all languages deserve an easy and repeatable way to upgrade their databases on deploy day, and this lens should put someone on the right track. 

Schema Refactoring Around the Web 


Track and record database schema versions

My first search for information regarding schema upgrades
turned up this article. It still holds true, and it provides
the foundational knowledge required for implementing schema
migrations from a technical and administrative point of view.


Evolutionary Database Design

Matt Stevens interviews Scott Ambler concerning his work in the field of
database refactoring. Scott is a heavyweight in the field. Want proof?
Keep reading, he's the author two books listed below.

Books About Database Refactoring and Schema Migrations 

These books go through the theory and mechanics of database schema migration in great detail. If you would like to avoid ad hoc migration plans, these books are well worth a read. Or maybe you simply learn better with a dead tree open on your desk.

Refactoring Databases: Evolutionary Database Design (Addison-Wesley Signature Series)

Amazon Price: $47.99 (as of 07/13/2009) Buy Now

Your Thoughts 

How do you handle database schema refactoring and migration? Any horror stories to scare folks straight? Please, share them here!

rose08 wrote...

Yes, data migration is sometimes a headache...check out my summer beach lens for relax...

ReplyPosted September 15, 2008

semanticdb wrote...

Hi,

Database schema refactoring was definitely a nightmare for me. But for the past 1 year I am using Poseidon Database its a Schemaless database which eliminates any kind of data modeling providing the fastest time to start, and needed peace of mind. It comes packed along with Brainwave Platform a complete development and deployment suite. http://www.brainwavelive.com/

-SW

ReplyPosted September 12, 2008

semanticdb wrote...

Hi,

Database schema refactoring was definitely a nightmare for me. But for the past 1 year I am using Poseidon Database its a Schemaless database which eliminates any kind of data modeling providing the fastest time to start, and needed peace of mind. It comes packed along with Brainwave Platform a complete development and deployment suite. http://www.brainwavelive.com/

-SW

ReplyPosted September 12, 2008

semanticdb wrote...

Hi,

Database schema refactoring was definitely a nightmare for me. But for the past 1 year I am using Poseidon Database its a Schemaless database which eliminates any kind of data modeling providing the fastest time to start, and needed peace of mind. It comes packed along with Brainwave Platform a complete development and deployment suite. http://www.brainwavelive.com/

-SW

ReplyPosted September 12, 2008

semanticdb wrote...

Hi,

Database schema refactoring was definitely a nightmare for me. But for the past 1 year I am using Poseidon Database its a Schemaless database which eliminates any kind of data modeling providing the fastest time to start, and needed peace of mind. It comes packed along with Brainwave Platform a complete development and deployment suite. http://www.brainwavelive.com/

-SW

ReplyPosted September 12, 2008

 
1 of 2 pages

by timfreund

I'm a web application developer who works with Java, Python, and Ruby.

I have personally used database migration tools with TurboGears and Ruby on Rail...

(more)

Favorited By

Create a Lens!