SQL Server on Linux Journey – Part 5: Containers
On Part 4 of this series we talked about running SQL Server on Linux HA terminology, components and demos and took a short break.
Now, we are back to cover containers and invite you to join us at PASS Virtual Summit (on demand until November, 2021) where we presented a session on “Modernizing SQL Server operations with Kubernetes” and two live demos on Azure QuickStart and Availability.
At a high level, containers can be leveraged both as a type of SQL engine deployment and as a solution to take advantage of Big Data Clusters, which is a new feature of SQL Server 2019 that we will cover on part 6 of this series.
So, what is a container?
Vin Yu, Program Manager at Microsoft, covered on a recent SUSECON Digital Session that, on a simplified view of an operating system (OS) you’d see a kernel space and a user space. The kernel space interacts with system resources, such as memory, CPUs etc. and the user space is where you’d see applications and libraries.
He goes on to say that if this OS was a container host, the container runtime engine would be one of the user space apps able to spin up containers such as the SQL Server container (a binary package with dependencies) but, you may ask: why would I do that? What are the benefits of containers?
And to answer your question, the benefits are: it is isolated (process or dependencies do not interact with others), consistent (containers will always behave the same way as specified in the build file), portable (dependencies are always shipped with the container no matter what environment, on premises or cloud), easy to use and start/stop and finally, it has no installation (apps inside the container are ready to run since all dependencies are laid out on container).
If you check out Vin Yu’s SUSECON session, you’ll see a demo on how to build your SQL Server container on SUSE Linux Enterprise Server starting at 6:45.
And what are some use cases?
Vin Yu details uses for Application Development and Database testing.
For application development you could take advantage of containers when you have various environments including production and dev/test and you need to speed up your build time; when you have ad-hoc testing against SQL Server instances that could simply be containers; or when you have short-lived applications such as monthly reports, machine learning models etc. where you would need access to some data but don`t need the instance up otherwise.
For database testing you could take advantage of containers when you have a need for a short-lived database as part of your continuous integration/delivery or DevOps pipelines that would need to be cleaned up for build/run; or when you need multiple instances to scale out your testing or test against multiple versions of SQL Server.
Another use case is when customers want to run more than one instance of SQL Server on the same host. If customers are using Linux, the only way to deploy more than one instance of SQL Server is to use containers. Each container would be an instance of SQL Server and thus, with multiple deployments of SQL containers on the same host customers can optimally use the resources of the host machine which is running the containers.
Container management at scale = Kubernetes
If you have a cluster of 100 machines how do you chose the node to deploy your container to and how could you effectively manage your containers at scale? Kubernetes!
Kubernetes (K8s) helps you orchestrate and manage containerized applications by simplifying deployment, management, scheduling and scaling of each containerized app. SUSE CaaS Platform is an enterprise grade solution to help you with that challenge and on the SUSECON Digital Session we mentioned above, starting at minute 18 you can see a demo on deploying SQL Server container on Kubernetes. By now, I`m sure you understand this is a must-watch session, right?
You can find files and instructions on how to build a SQL Server on SLES container image on GitHub and leverage the Microsoft Documentation to deploy a SQL Server container in Kubernetes with Azure Kubernetes Services (AKS) to follow similar steps with SUSE CaaS Platform.
Next stop… Part 6 & PASS Virtual Summit
On Part 6 (and final) of this series we talk about Big Data Clusters, which closes the gap between structured and unstructured data by integrating the SQL Engine, Spark, and data lakes.
Click to learn more