Devops

DevOps: To branch or not to branch

One of the discussions that comes up from time to time when working with DevOps is branching strategy. One of the main features of Git that’s often claimed is that it’s so good at branching and merging. And indeed, it’s pretty good at that. But the bigger question is whether lots of branching is desirable in the first place. One argument says that if you are using branches (let’s say to build features), that you really aren’t doing Continuous Integration (CI).

2018-04-27

DevOps: Scripting SQL Server objects and data from the command line

The other day I posted a shortcut about how to use SQL Server Management Studio (SSMS) to generate INSERT statements for data. In one of the comments, Tom Corrigan asked if there was a way to do that from the command line. The answer is yes. Apart from a variety of 3rd party tools, in May last year, Microsoft released tools to do just that. The new tool is mssql-scripter and you’ll find an intro to it here:

2018-04-20

Opinion: Which SQL Server columns should be nullable #2: Avoid placeholder values

In my previous opinion post, I was discussing why magic values where a problem. They are often added by developers when they are trying to avoid having any NULL data in a database. While discussing this, I think it’s worth also highlighting the overall dangers of placeholder values. These are values that aren’t magic values but are ones that are intended to be replaced at a later time. If you use any of these, you need to have a solid process in place to:

2018-04-17

DevOps: What is a managed service?

Some time back, I decided to use a WordPress host for my blog because the time for me at sqlblog.com was coming to an end, community service was on its last legs, and WordPress seemed the obvious platform for a blog. Fellow MVP Adam Machanic made it really easy for me to migrate to a WordPress site with a tool that he had created. Along with another site, I put them onto BlueHost and had reasonable hopes for them.

2018-04-13

DevOps: Human testing is still critical - and make sure they can spell

I’ve spent a lot of time lately working with automated testing systems. Unit tests are great for checking blocks of code, etc. but integration tests and functionality tests are critical to projects. An area that is still tricky though is UI testing. There are some really good tools for this. Selenium has been very popular and works well if you access it programmatically. There are good framework libraries for .NET and we’ve been using those.

2018-03-30

DevOps: Keep moving forward not backwards when deploying to production

I was asked a curious question the other day: “Are all changes made to production systems actually deployments?” I wish the answer was yes, but unfortunately patches do get applied directly to production systems without going through standard deployment processes. Everyone understands the scenario. Code has been deployed using the normal processes, then someone has something that simply must be fixed urgently in the productions systems. At that point, you have two choices:

2018-03-23

DevOps: SQL Server and Unit Test Challenges

I had a previous life as a developer and ran a software-development house. Even then, I was very focussed on data. I don’t think I’ve ever had a BD (before data) period. I see almost everything I’ve ever worked on in data-related terms, so perhaps it’s the time before I focussed on data. But what this does mean is that whenever I get together with other data-related people, I’m one of the people who is asking why things that are taken for granted in the developer community, aren’t present in SQL Server and its T-SQL language.

2018-03-16

DevOps: Avoiding SQL Server Clone databases growing way too large

I’ve recently been making use of SQL Clone from Redgate, at various client sites. I have to say that I really like it. The basic concept is that you take an existing SQL Server database, you create an “image” from it, then you create database clones from that image. Under the covers, it’s basically a differencing technology. The initial image is like an initial set of database files, and each clone is then files that are differenced from that.

2018-03-09

DevOps: Should migration-based deployments use idempotent scripts?

In my last DevOps-related post, I discussed some of the issues that arise when using migration-based deployments. Migration-based deployments are based on a series of T-SQL scripts that apply changes to your database from its current state to a desired final state. One of the questions that arises though, is whether or not these T-SQL scripts should be idempotent ie: Should the script be written so that you get the same outcome if you run the scripts multiple times?

2018-03-02

DevOps: Dealing with issues in migration-based deployment of databases

In an earlier post, I described the difference between state-based deployments and migration-based deployments. What I want to talk about today are two of the main issues that can arise in a migration-based deployment and what to do about one of them. When you are using a migration-based deployment technique, you are storing all the scripts that take a database from its current state to the desired final state. While tools like Ready Roll make this is a relatively easy way to perform migrations, it suffers from a few key problems:

2018-02-23