7 Best Practices for Database Deployment
The database is a bottleneck to application deployments. Survey after survey shows that Database Managers and Application Development Managers agree. In each survey, over 90% of professionals involved in software releases are feeling the pain of database deployments.
In many organizations, database deployments are managed by teams outside of the core application development team. Since the database and application must be released as a unit, this two-path approach to deployments is difficult to manage and can create serious visibility problems. While many developers don’t want to admit it, application deployments are very much everybody’s problem.
Here are 7 best practices to improve your team’s database deployments
1. Create visibility in all processes to anticipate problems
Limited visibility can increase the cost of database deployment and gives less time to react to problems. Without visibility, we don’t understand the impact database changes will have on the application, which causes us to move slower.
The same is true for database deployments. With more visibility into the impact of database change, you can see and fix problems before they become issues. This also has the added benefit of allowing faster deployments.
2. Measure every bit of code change
Teams should track every bit of code as it moves through the Software Development Lifecycle (SDLC). With the proper tracking, a team can improve application development thanks to data from:
- User story creation
Furthermore, if your team sees a large number of build failures that are delaying application artifact delivery, they can determine the issue and fix it.
The same cannot be said with database deployments. Typically, when a database deployment is needed, someone will create a helpdesk ticket for the DBAs. Then, the team may attach a SQL script or describe the change in the body of the ticket. And then… there is a long wait.
Without insight into how long it takes to accept the ticket, review it, approve it, and schedule for deployment, the entire database deployment process is a black box. No one knows if the process needs to improve acceptance speed or approval speed. Where does management need to apply more resources to improve our process? The answer is a shrug, which should terrify those with P&L responsibility for the business unit building the application.
3. Automate database deployment to alert team members for problem
Developers are impatient. As Development moves forward to the next sprint, moving back to a previous sprint to fix a database update problem is painful. This not only slows the progress of the current sprint but also forces dev teams to mentally switch to resolve the database deployment issue found by a Production DBA.
This difficulty can be avoided with database deployment automation. The automation process can alert necessary team members that the DB change was not sufficient. Until then, we are going to have to deal with “out of band” changes and interruptions.
4. Encourage your DBAs to tell you “No”
By having insight into database deployments, you can see why changes are being rejected and integrate those learnings into your development process.
Waiting until a Production maintenance window to find out if your proposed database changes are acceptable is inefficient. Understanding what is acceptable to DBAs allows Development to avoid wait states and rework.
If your database team has standards, you need to know what those standards are so you can adhere to them. When expectations are clearly defined, those expectations will be met.
However, there are instances of “DBA shopping” in companies with loosely defined standards and uneven enforcement. Development teams will seek out DBAs that are lax or inexperienced for complex deployments. Thinking that the lack of oversight will improve the likelihood of a successful deployment, the dev teams will actually cause more work. Without a knowledgeable DBA, database changes get pushed to production, causing more work down the line.
5. Encourage hands-on application work until it’s in the hands of the customer
If your application is not in the hands of the customers, they are seeing no benefit from your development efforts. Thus, there really was no point in your making those code changes in the first place. Moreover, app development requires feedback from the customer to improve. That feedback is impossible to receive until the customer is using the application. By relying on a slow, manual, error-prone process to update the database, you slow down your actual database deployments. You must automate the entire application process, not just the application itself.
6. Create the best team possible
As software becomes more and more linked to business performance, it also becomes more and more complex. No one has complete knowledge of all software systems that a business relies on. This is seen in the software development lifecycle. The further left you are in the SDLC, the more knowledge you have of the application. The further right you are, the more knowledge you have of the environment. By having insight into the later stage environments, especially the database layer, developers can help Production DBAs. With this relief, developers can deliver changes that deploy to all environments in the SDLC.
There will be times that database standards should not be applied to a specific change. For example, if a new column needs to be added with default values, most DBAs will reject the change. In the past, new columns with default values would cause a DML lock on a table while the default value is updated row by row. Furthermore, this sort of change can be viewed by the DBA as code smell. Instead, the DBA may insist that the data insert should be made only by the application code.
7. Bring DevOps to the database. Treat database code like app code.
One of the most integral aspects of database deployment is the culture of database DevOps. Companies that adopt DevOps have a higher market capitalization growth rate (total stock outstanding X stock price) than their competitors. DevOps adopters also outperform the S&P 500.
With DevOps, we’ve seen high performing IT organizations quickly attacking new markets and expanding rapidly in existing markets. If your company does not adopt DevOps, you will be looking for a new job because your company will eventually fail.
Development teams may look at database deployments as somebody else’s problem or a mere annoyance. But the truth is that the state of the database deployments of an organization can affect a developer’s paycheck. Thanks to database DevOps and CI/CD for databases, jobs are now at risk due to competitive threats from other companies that are more agile from an IT perspective.
There is a solution, though. Automated database deployments or Application Release Automation can help. To complete the task, you must have your DB changes follow the same path as your application changes. That means:
- Using the same source code repository for both database and application changes
- Providing lights out and single click deployments for all environments
- Demanding immediate feedback to proposed database changes like you have for your code
If you have already applied these patterns to your application code, it’s time to bring the database deployment into the future the same way.
To learn more about the role of developers in database DevOps read: Making DB Changes Easy for Application Developers.
Not sure where to start with database automation? Sit down with one of Datical’s database specialists to discuss your unique requirements and how to build the best database CI/CD foundation for your software releases.