The Future of Database Development (with containers) DevOps is a hot topic in today’s software development world. However most of the knowledge and experience with DevOps is based around application software and ignores the database. We will examine how the concepts and principles of DevOps can be applied to database development by looking at both automated comparison analysis as well as migration script management. Automated building, testing, and deployment of database changes will be shown. https://unsplash.com/photos/IMUwe-p1yqs The Future of Database Development (with containers) Steve Jones Editor, SQLServerCentral Redgate Software
Agenda Who am I? Getting Started on a Database Project Container Primer Branching for Experiments Fixing Mistakes Easy Continuous Integration Agenda
Steve Jones 28 years SQL Server data experience DBA, developer, manager, writer, speaker in a variety of companies and industries Founder, SQLServerCentral Currently the editor in chief, with the goal of helping you learn to be a better data professional every day Steve Jones DevOps Advocate, Redgate Software Editor, SQLServerCentral 12 year Microsoft Data Platform MVP steve I have been honored to be recognized by Microsoft for the as a Data Platform MVP working with SQL Server /in/way0utwest @way0utwest sjones@sqlservercentral.com www.voiceofthedba.com
Getting Started I got a new gig… They're letting me do web development!!!! I don’t want to worry about databases I don’t have SQL installed (No services running) I have cloned the source code (git clone)
SQL Server Shared Account database Frontend web .NET Core API PostgreSQL Todo database
I get a login to Spawn (DBaaS)
Demo Getting a new developer started Nothing installed Cloned project Spawn login Yarn start Connect to RDBMS(s)
What are containers? Or how are these different from virtual machines? https://hub.docker.com/_/microsoft-mssql-server Or how are these different from virtual machines?
App App App Operating System Operating System Operating System Container Container Container Container Container Container Container Container Container Container Container Container VM VM VM Container Container Container Container Container Container Container Container Container Container Container Hypervisor Docker runtime Operating System Operating System Image Hardware Hardware
What is a container? Started in Linux as a lightweight way to provide a full fledged Linux environment without starting a full VM LXC were early Linux containers Docker built their own container engine Uses the host kernel Provides a separated environment for applications Virtualizes OS resources Namespaces Control groups
What are Images? In the container world, an image is a template of the filesystem We build these with layers A unified file system combines these layers to give a consistent view The layers are read only Images are downloaded and used to create an instance of a container
Images and Containers The container is an instance of the Image All containers share the image Each container gets a separate writeable layer Changes exist in this writeable layer The unified file system keeps a consistent view Changes made to the writeable layer persist through pause/stop A volume may be mounted from the host inside the container
Development Challenges https://hub.docker.com/_/microsoft-mssql-server Development Challenges How containers help
Branching A typical concern is I want to try something However, I don’t want to disturb other’s work Branches allow me to experiment and commit separately I can discard these, recreate these as needed, which means I want the database to do the same. I can merge in changes that work
Demo Branching - Checkout new branch - Getting a new data container
Oops, I did it again Often, I make some mistakes in development Usually, I can’t remember or don’t know the code to reset the database This is frustrating because app code just resets
Demo Reset Delete/change data Spawnctl reset data-container
Recap DBaaS removes the need to manage the server component Containers provide a known, consistent starting point Integration with easy deployment as a part of app config Reset can speed up testing of data issues
Continuous Integration Independent Verification and Validation
Independent Validation with CI We want to check changes (committed) by developers Avoid the "it works on my machine" The CI process should be simple and seamless
Demo Continuous Integration
Questions How does this work? Who would use / want something like this? Data Set Management? Issues? Advantages?
Summary DBaaS is the future Containers make development easy(-ier) Handle branching easily for experimentation Reset immediately Parallelize testing with a database Lightweight and reduce setup DBAs still have control
The End www.voiceofthedba.com sjones@sqlservercentral.com @way0utwest /in/way0utwest