Automate Delivery of SQL Server Production Data to the Dev Team
If you're interested in using containers in Windows, check out the latest developments for WinDocks, a port of Docker that provides .NET, Java, and now SQL Server support.
Join the DZone community and get the full member experience.Join For Free
windocks is a port of docker’s open source to windows, providing .net, sql server, and java in containerized environments for development, test, and qa. based on the performance and customer feedback, we expect windows containers to follow a similar pattern of adoption as on linux and become the preferred infrastructure for delivery of environments for dev, test, and qa.
sql server containers are a big step forward in terms of efficiency. where most organizations are testing sql server environments twice monthly, the process outlined here makes it practical to provide daily (or even more frequent) environments.
windocks is available as a free community edition and supports windows 8, windows 10, windows server 2012, and windows server 2016. windocks supports .net, and all editions of sql server 2008 onward, and java with tomcat or jetty, nginx, and node.js.
containers for daily production data environments
windocks installs on a bare metal or a vm host, and even a windows 8 laptop can provide reasonable service for a team. once added, the server supports a group of developers with isolated container environments. where up to 20 vms were used previously to support a team, with containers a single machine serves the purpose, with each developer using isolated container environments. containerized environments are delivered in seconds, and the dramatic reduction in vms yields an immediate and significant savings on microsoft server license costs.
a typical user works with a two-tier application, using .net with sql server. the database used could be recovered from a backup, or a daily replica. in the simplest case the databases are copied into a container, which is used to create an image, and the image then supports the team with identical containers. alternativey, the databases can be cloned, and then mounted to new containers. using mounted database clones saves time in copying the data into each container, and provides a writable copy of the data and saves on storage costs.
containers are defined by dockerfiles, which specify the base image, container names, port assignments, paths to databases, git repos for pulling code, and sql server scripts. the dockerfile also includes storage commands for generating the database snapshot and clones, using netapp, equallogic, or similar systems. incorporating storage system support into dockerfiles allows a dba or devops engineer to support a dev or test team with self-service environments. finally, a powershell script automates the creation of the complete environment.
a step-by-step view of the process includes:
- snapshots of the production databases are made, each being a writable copy. in this example, the snapshots are cloned and mounted to each sql server container. smaller databases can also be copied and run in the sql server container.
- a powershell script runs the >docker build on the sql server dockerfile.
- the sql server container is started and build-time scripts are run (for data masking, and other needs).
- the powershell script parses the sql server container port and credentials to be used in the associated .net web.config file.
- powershell runs the docker build of the .net dockerfile. the dockerfile includes a git pull from the github repos. the web.config file is updated with the sql server container port and credentials and saved. the dockerfile can also specify container ports and naming.
- the .net container is started. the integrated environment includes a .net application based on the latest code and a paired sql server container using the most recent db snapshots.
a shared vm supports up to 20 simultaneous running environments, each provisioned in just 100 seconds. the front-end and back-end teams can replicate bugs quickly and validate tests by simply choosing the appropriate branch in the build script. bugs are resolved quickly and easily.
one windocks customer uses a bare metal host with eight cores and 96 gb of ram to support up to twenty sql server containers for dev and test. each container includes over twenty five databases running in the container (not mounted), with an average size of 100 gb. prior to using containers, each vm took over an hour to provision. using windocks, the provisioning time is down to a couple of minutes. the result is a 20x reduction in vms, a 5:1 reduction in cpu cores, and dramatic financial savings in ms license costs.
the windocks team is building quite a bit of experience in working with a range of storage systems, including netapp, equallogic, and others. we can generally provide the dockerfiles and steps involved to setup this process in a single call. if you’re interested but uncertain as to your ability to setup such an environment we offer a $500 guaranteed quickstart service designed to provide a turn-key environment.
containers are a dramatic step forward for support of developers and test, and the ability to support sql server in containers should be a boon for windows based development. it’s reasonable to expect that sql server environments can be provided daily, with the latest production data, using a simple automated process. developers should be happy with daily, on-demand access to fresh, isolated environments. management should be happy with added productivity, and cutting the microsoft license bill in half!
Opinions expressed by DZone contributors are their own.