SQL DevOps on a budget
Over the years, I have done many projects with large Microsoft SQL (MSSQL) or Oracle database environments. In fact, I have done a lot around automating those platforms for Test&Dev environments. It always seems to come down to writing deployment strategies and automation scripts, typically using one of my many SQL Cookbooks in Chef. Recently, I learned of a new product from a company called WinDocks. I have done a lot of work with Docker in the past so I was very interested in seeing what this windows port of the docker engine could do. I was even more excited to learn that I could do SQL containers.
As our story unfolds, a young DevOps engineer comes to me and says that they are having difficulties delivering the build-environment for a new web application. Specifically, this environment is leveraging .Net and MSSQL for the backend while the front end is all in AngularJS. Ok, my ears are definitely perked up and I listen to his tale of woe. It seems that they keep having to rebuild the environment and losing time on the very tight schedule. At no fault to their own, the front end team just doesn’t know or do anything in Windows. This means that the DevOps engineer has to spend several hours, which turned to days, with the developers to build out a Vagrant VM for Windows and train them on how to deploy things. This was killing productivity and development had almost come to a halt.
Recently, the team had started testing out NetApp in AWS using ONTAP Cloud so I had an idea. What if we were able to leverage the Flexclones in ONTAP Cloud and take a closer look at this new solution that I found called WinDocks. The team wanted to keep the infrastructure cost in AWS down as much as possible and for this reason they were trying desperately to get the vagrant solution to work. We determined that every developer needed at least two parts of the stack to make this work and the client ran IIS and SQL on separate boxes so this made it even more important for us to test as close to the real thing as we could.
Let me stop and give you a bit of information about WinDocks. The solution installs on Windows 2012 or greater and provides the ability to run the docker engine natively. There was another very interesting detail that I learned. These aren’t your traditional container with a base OS and then the application. The product actually creates application containers which meant that we were getting as close to real as we could ask. Natively, the solution will support .NET and MSSQL while the latter requires that at least one base installation of SQL of your choice exists. Wait… stop the presses! I only need one installation and I can run as many containers as I need? This seemed like an excellent solution to our problem and solved our infrastructure needs. There was a bit of a learning curve when coming from a traditional Docker environment and the features aren’t 100% in parity but the WinDocks team has done a great job of adding features every month or so.
So, we have an idea on how this will work. Since we had a 200Gb database seed from the client, we also needed an easy way to refresh the environment. Our plan was to create a production container that wrote all of its data to NetApp iSCSI Luns. Now with Flexclones, we can simply create a clone of the databases on those Luns and then present them back to the new containers. With a little… who am I kidding, a lot… of PowerShell-foo, we had a simple script that would redeploy each backend container for the front end developers. Five environments, one .NET container and one SQL2014 container per developer, could be created in less than 2mins each. We even ran the User Acceptance Testing from a set of containers by adding a second .NET container to the pod to run the front end code. The developers, QA, DevOps, and client loved the solution and the speed.
In the end, we were able to cut at least 10 servers and the headache of shared environments for developers. The dev team also didn’t have to worry about running multiple systems. Oh, when the client said that the application needed to integrate with Active Directory, we just had to add a second server to run Active Directory and join the WinDocks build-environment. Redeploy the containers and as my 3yr would say … ‘Laaaaa’… everything was up and running. Later we decided to have some fun and try this environment in Azure but I will save that for another story.
If you are looking for a way to improve and increase your DevOps delivery of SQL Server or even containers on Windows 2012, take a look at the guys at WinDocks. Until next time…