You're a developer in a team of four. You have a build machine and your software has two databases that it accesses (can be any number...usually one):-
  • Northwind
  • AdventureWorks

You implement a new feature in your software that involves a few changes to both databases. They are all slightly different changes so you have four different scripts. For your feature to work it's important that all of the changes are successfully applied to both databases.

You have also created some unit tests, checking your feature works correctly. These will fail if the database changes have not been applied.

The feature is complete and you check in all of your files into your source repository.

On the build machine your build process kicks off and one of the first things it does is run DBUpdater. It runs your scripts against both databases inside of one transaction. The first two against Northwind run ok and so does the third against AdventureWorks. But your fourth script failed because of a syntax error.

The build breaks and the transaction is rolled back, restoring the database to the exact same state it was in before the updates began.

You fix the script, check it in again, this time it all works and the changes are to both databases are committed. Now your tests will work as the database changes were automatically applied.

Your colleague, Bob, is running a local instance of the database. Bob gets the latest version (which includes your new feature and database changes). As soon as he has the latest source, Bob runs DBUpdater and your changes (along with all other recent updates) are applied to his local database instance, ensuring he can continue to work without interuption :-)

Last edited May 28, 2008 at 2:53 PM by wallism, version 2

Comments

No comments yet.