Guest Blog: All Your Base Are Belong To Us: Enterprise Developers & Database Versioning

This week’s blog is from Jon Cwiak (Blog | Twitter), senior software engineer at Humana, Microsoft Certified Professional at building things, and Tech on Tap – Nothing But .NET speaker. He’s going to introduce us to Database Versioning.


History

Every once and while you stumble on an internet meme that haven’t seen in years. In the late 1990’s the internet gifted us a popular catchphrase the swept the world. “All Your Base Are Belong to Us” came from a video game called Zero Wing from 1989 with a poorly translated Japanese to English phrase in one of the opening scenes. I stumbled over this again the other day and it got me thinking; not only about video games but about databases. Are developers really getting “all of your base” when it comes to their database & development process? I don’t think they are.

Like the video games from the late 80’s early 90’s, thinking about a database outside of source control seems so dated….until you have a conversation with one of the many “dark matter” developers as Scott Hanselman so prophetically coined. Enterprise developers in large shops are often insulated from the state of the art or simply work for shops that don’t embrace change as swiftly as the rest of the interwebs. Enter database versioning; during conversations it often amazes me that the data tier of many application are often not in source control and/or may linger on shared servers; dark places where it’s so easy to change something…. but also so very easy to drop that really important table you’ve been designing, or stored procedure your colleague has been tuning. When asked about versioning, developers react as though tables, views, stored procedures, etc are something other than code. No friends, database backups are not a form of source control.

Database versioning is nothing new; Tooling has been around for your favorite database platforms forever but somehow developers have not fully embraced these tools or realized that they can go faster and develop with less fear if they embrace such tools. Over the years, the solutions on the Microsoft stack have evolved from copies of text files in Visual Source Safe to modern SSDT & TFS. The following is a brief history of the tools and why you want to reconsider what you’re getting from you “base”.

Visual Studio Puberty Edition

Back when Visual Studio was going through “the change”, we had Database Projects. These projects allowed us to put code in source control, get cool features like deployment and round tripping, compare database schemas and so many other neato features. But these features were limited, had problems with enterprise deployment scenarios, and were often not very good for multiple developer use cases. Development in 2005/2008 was downright medieval; it’s time to grow up.

 Figure 1-Medieval Development with a VS2005 Database Project


Figure 1-Medieval Development with a VS2005 Database Project

Visual Studio Young Adult Edition

Visual Studio grew up, went to college, got a job, and entered the enterprise. Enter Visual Studio reasonably current (2012/2013); These editions of VS now come armed and ready to rock with the SQL Server Data Tools platform….and oh what a difference it makes. SSDT is the replacement tooling introduced for VS2010 to replace the aging Team System Database Projects. SSDT provides rich integration with Visual Studio while allowing itself to be updated out of band as new fixes and features are shipped. Gone are the days when VS versions had to match SQL Server targets; SSDT now supports targeting to allow you to deploy to SQL Server 2008 and better. Deployment is better; Migration is better; Life is better.

Figure 2- Visual Studio in the Enlightenment Era SSDT

Figure 2- Visual Studio in the Enlightenment Era SSDT

You and Your Team

If you’re not already treating your database with the respect it deserves please do so and put it under source control. If you’re using TFS, Visual Studio Online, Git via VS Online or something else, consider using SSDT to source control your assets. Using this (or any other tool) lets you and your team develop faster, with less fear, and react to scenarios where you need to deploy “the whole stack” to a new environment (including disaster recovery) using source control as the source of truth. SSDT helps me get the most out of my “base” and hope it does for you too.

Want to Learn More?

Check out the SSDT blog at https://msdn.microsoft.com/en-us/data/tools.aspx

Tags: , ,

One Response to “Guest Blog: All Your Base Are Belong To Us: Enterprise Developers & Database Versioning”

  1. Jes February 3, 2015 at 3:24 pm #

    “Database backups are not a form of source control.” As a long-time DBA and SQL Server consultant, I can’t agree more. Trying to get a past version of an object out of a database is messy and means we either lose data or make someone angry.