DevOps - Part 5.1 - Handle DB changes - Intro

DevOps - Part 5.1 - Handle DB changes - Intro

This part 5 of a the series describing a minimum setup for a modern DevOps culture for mature organizations, I present a solution for the biggest stumbling block that decisively halts progress for many teams.

Yet, it is not a hard problem to fix.

Today we will deal with database changes

I will show how to automate deployment of database changes just like any other code changes.

Why is that difficult?

Unlike Java or .NET code, which we simply replace wholesale during a release of a new version, database (or any other type of datastore) is stateful and cannot be simply replaced. Changes to a stateful datastore, must be carefully applied.

The solution

I will present a fool-proof, battle-tested and battle-hardened method, that will solve this problem. The example will use a SQL database (SQL Server in particular) but the process can be easily adopted to pretty much any datastore you may have.

What I will present is nothing revolutionary. Entity Frameworks have already solved this via migrations. What we will build is similar, but it is applicable to any SQL database, no matter how ancient.

Please note that this entire guide focuses on “mature systems”. Systems that have been around 10, 15 or 20+ years. Typically, these systems have a SQL database backend with heavy use of executable database objects such as stored procedures. Often hundreds of them.

We will not attempt to “fix” this setup, by imposing our contemporary convictions that “stored procedures are evil” and must therefore be eradicated . Not only is this not feasible in most cases, it is unnecessary. We will handle such as setup as gracefully as we do a modern containerized applications running on Kubernetes.

The method will handle all kinds of database changes. So far, I have not ?come across anything that this method could not handle.

How to use this guide

This is probably the most complicated (and in my experience most resisted) part of the transition to DevOps. Often, the teams do not believe me that this can be done.

The approach I will take is to slowly build the solution, from the ground up, by examples, justifying each step we make. I highly recommend that you follow it closely as this will greatly increase your understanding of solution.

However, a fully completed solution is available on my GitHub.

NEXT : Continue to part 5.2...


要查看或添加评论,请登录

Greg Bala的更多文章

社区洞察

其他会员也浏览了