If you haven’t been paying a lot of attention, you might have missed the rise of a new form of virtualization, based at the operating system level, called “containers.” While there are many specific software programs, by far the most prominent is Docker. So, from here on out, consider “Docker” and “container” to be synonymous.
Docker containers, as I mentioned, virtualize at the operating system level. Within Docker, you can include an entire application, tools, libraries, and configuration files. For example, you might build out a Docker container that “contains” a SQL Server database engine, IIS, SQL Server Reporting Services (SSRS), and all of the reports that run off of that container. Other examples you can check out right now are many of the machine learning images posted by Microsoft at https://gallery.azure.ai. You could send SQL and T-SQL commands to it similar to a regular hardware- or VM-based instance of SQL Server.
But because it doesn’t need to instantiate the lower-level software the way a VM does, it is much smaller and a great deal faster to spin up or tear down. And, since it’s so lightweight, you can run many more Docker nodes than you can VMs. In my own case, I don’t run more than two VMs at a time on my laptop. But I’ve gone as high as six Docker containers, and with lower overhead, too!
Docker in Relation to Linux, Windows, and SQL Server
Docker is primarily a product for Linux, although it does run on Windows and MacOS. But this complicates things for the DBA who wants to run SQL Server in Docker containers. First, if you are willing and have the skills to run SQL Server on Linux, go for it. Docker on Linux is fully supported by Microsoft and has all the features you could want.
However, Docker for Windows (as released by Microsoft) has a couple of important limitations:
- ?First, and it’s a big one, it lacks support for Active Directory and Windows Authentication. There are workarounds using managed service accounts, but they’re somewhat of a kludge in my opinion. ?Read more at https://docs.microsoft.com/en-us?/virtualization/windowscontainers/manage-containers?/manage-serviceaccounts.
- ?No support for RDP or a GUI. It’s pretty much PowerShell and command-line interfaces or nothing.
- ?Since Microsoft’s implementation of Windows-based Docker containers is rather quirky, here are a couple other notes to be aware of:
o ?It puts more of the operating system footprint (based on Windows Nano Server) into the container, thus making most images greater than 10GB. That’s a big drawback since a Linux-based container with the same functionality might weigh in at about 2GB.
o ?It must be rebuilt whenever a Windows update occurs.
o ?It breaks compatibility with several important helper apps for SQL Server, such as SQL Writer and Volume Shadow Copy Service.
While the Linux-based offering from Microsoft sees plenty of attention from development teams in Redmond, I ?haven’t seen anything new for the ?Windows-based offering in at least a year. Based on those quibbles, I’d suggest if you want top-tier Docker support that you either get comfortable with Linux (and PowerShell) or you investigate alternative third-party tools. My personal recommendation for a third-party tool is Windocks. The Windocks team supports not only SQL Server images, but also recently added support for SSRS images as well as expanded database cloning from enterprise storage arrays. Check out https://Windocks.com for more information.
Orchestration—The Way to Deal With Lots of Docker Containers
Let’s say that you’re comfortably on your way forward with Docker containers, not only using them to run complete databases, applications, and micro-services but also automating their workflows en masse. How do you keep all of them working well together? Enter the “orchestration” category of software. Again, just as there are more suppliers of containers than Docker, there are multiple suppliers of orchestration software. But for the purposes of this article, I’m primarily talking about Kubernetes (frequently abbreviated as “k8s”).
Kubernetes is a Google creation, and the company manages all of its worldwide data centers using Kubernetes in an elegant ballet of automation. I am not going to go into as much detail about Kubernetes, which means “helmsman” in Greek, as I did with Docker because it really is overkill for all but large estates. Furthermore, Kubernetes is not something you’ll be using on existing IT systems. It is entirely designed to support hyper-scale greenfield micro-service architecture-based SaaS applications. Using Kubernetes, you can scale up your infrastructure to a vast number of nodes in distributed clusters to manage things such as load balancing, spinning up and down services as needed across the cluster.
Are You Using Docker?
Are you using SQL Server inside of Docker containers? Then I want to know more about your experiences! Feel free to contact me.