Why Code Quality is Vital in the World of Database DevOps
June 05, 2018

Matt Hilbert
Redgate Software

Everyone understands the importance of code quality for applications, particularly when DevOps results in releases becoming faster and faster, reducing the room for error. The same issues increasingly apply to databases, which are a vital part of DevOps workflows. Fail to integrate the database into DevOps and you'll face bottlenecks that slow down your processes and undermine your efforts.

Obviously DevOps has to combine speed and quality. However, with larger and larger teams delivering more and more releases under ever-tighter timescales, ensuring consistency and code quality can be an issue.

This is particularly true when you have mixed teams combining both application and database developers, who have different backgrounds, skills and ways of coding. Or, increasingly, where application developers are expected to update the database as well as the application.

How can you ensure consistency and quality, and avoid the database being a drag on development? The key lies in looking for the same kind of productivity tool that application developers expect to help them write code faster, more accurately, while encouraging collaboration.

There are three areas in particular that companies should look to embrace:

1. Apply team styles

One of the biggest challenges for any developer coming to a new project with an unfamiliar codebase is getting to grips with the way the code is written and formatted. Just as application developers with different backgrounds will write code in slightly different ways, the same applies to database code such as T-SQL, used in SQL Server.

While the code will still do its job, trying to manage multiple writing styles adds to the overhead, particularly when it comes to testing and maintenance or if a developer has left, leaving someone else to puzzle over their work.

At the same time, mandating that everyone writes in a certain way is unrealistic — it will cause ill-feeling, add to training time and slow down coding. Instead, look at creating team styles that you can share across the organization, and adopt tools that let you apply them to code after it has been written.

That means developers can write in their own style and then see their work automatically switched to the house style, giving the perfect balance between what individuals and teams need to be more productive.

2. Share reusable code snippets

As with general software development, writing database code often involves repetition, with developers needing to achieve the same thing, multiple times. Rather than reinventing the wheel and making developers write code from scratch, use reusable code snippets for common routines that can be shared among the team.

This not only reduces the time to write new code, but also significantly lowers the risk of syntax errors sneaking in, particularly if you have a mixed team when it comes to experience and knowledge.

The result is that code is easier to understand, faster to test and ultimately quicker to deploy, ensuring DevOps requirements are met.

3. Expect real-time code analysis

Any productivity tool used for writing T-SQL will provide auto-complete suggestions as the code is written, reducing errors and speeding up coding. That's no longer enough. DevOps is all about shifting left, identifying issues earlier in the development process and fixing them before they become problems.

So look for a tool that also highlights code problems and pitfalls in code, the moment it is typed, and provides clear explanations, suggestions to improve the code, and links to further information. That way, code smells are avoided, and the quality of code is consistent, even among relatively inexperienced developers.

Every organization will have its own standards and ways of working, so ensure you choose a tool that lets you customize the analysis rules and how they are applied, so they fit in with your DevOps workflows.

Data is a vital part of every business, meaning databases are at the heart of successful DevOps. With more than 75% of organizations now having developers in their teams who work across both applications and databases, you need to ensure code quality is continually enforced. That's why you should extend code analysis to cover your database as well as your applications if you want to drive DevOps forward.

Matt Hilbert is a Technology Writer at Redgate Software

The Latest

August 16, 2018

There once was a time in software development where developers could design, build and then think about their software's security. However in today's highly connected, API-driven application environment, this approach is simply too risky as it exposes the software to vulnerabilities ...

August 15, 2018

Microservices are a hot topic in IT circles these days. The idea of a modular approach to system building – where you have numerous, smaller software services that talk to each other instead of monolithic components – has many benefits ...

August 13, 2018

Agile is expanding within the enterprise. Agile adoption is growing within organizations, both more broadly and deeply, according to the 12th annual State of Agile report from CollabNet VersionOne. A higher percentage of respondents this year report that "all or almost all" of their teams are agile, and that agile principles and practices are being adopted at higher levels in the organization ...

August 09, 2018

For the past 13 years, the Ponemon Institute has examined the cost associated with data breaches of less than 100,000 records, finding that the costs have steadily risen over the course of the study. The average cost of a data breach was $3.86 million in the 2018 study, compared to $3.50 million in 2014 – representing nearly 10 percent net increase over the past 5 years of the study ...

August 08, 2018

Hidden costs in data breaches – such as lost business, negative impact on reputation and employee time spent on recovery – are difficult and expensive to manage, according to the 2018 Cost of a Data Breach Study, sponsored by IBM Security and conducted by Ponemon Institute. The study found that the average cost of a data breach globally is $3.86 million ...

August 06, 2018

The previous chapter in this WhiteHat Security series discussed dependencies as the second step of the Twelve-Factor App. This next chapter examines the security component of step three of the Twelve-Factor methodology — storing configurations within the environment.

August 02, 2018

Results from new Forrester Consulting research reveal the 20 most important Agile and DevOps quality metrics that separate DevOps/Agile experts from their less advanced peers ...

July 31, 2018

Even organizations that understand the importance of cybersecurity in theory often stumble when it comes to marrying security initiatives with their development and operations processes. Most businesses agree that everyone should be responsible for security, but this principle is not being upheld on a day-to-day basis in many organizations. That’s bad news for everyone. Here are some best practices for implementing SecOps ...

July 30, 2018

While the technologies, processes, and cultural shifts of DevOps have improved the ability of software teams to deliver reliable work rapidly and effectively, security has not been a focal point in the transformation of cloud IT infrastructure. SecOps is a methodology that seeks to address this by operationalizing and hardening security throughout the software lifecycle ...

July 26, 2018

Organizations are shifting away from traditional, monolithic architectures, with three-quarters of survey respondents delivering at least some of their applications and more than one-third delivering most of their applications as microservices, according to the State of DevOps Observability Report from Scalyr ...

Share this