The Challenges of Database Change Deployment Processes — Part 4
A continuation of a series on the difficulties in implementing Continuous Delivery processes for database changes.
Join the DZone community and get the full member experience.Join For Free
this is the final part of a 4 part series on database deployment automation. in part 3 we examined the shortfalls of the commonly used “compare and sync" method. we will now reveal the proven best practices database automation.
achieving automation by scripting database objects change-scripts into traditional version control is limited, inflexible, disconnected from the database itself, and may be untrue and prone to miss updates of target environment because of conflicting scripts. using ‘compare & sync’ tools is a risky thing to automate. the two concepts do not play together, as one is unaware of the other. a better solution must be found.
in order to take a database into proper automation, you must factor in the following:
- proper database version control, dealing with databases’ unique challenges (structure, code & content), while enforcing a single work process. this prevents any out of process changes, code overrides, or incomplete updates.
- leverage proven version control best practices (check in&out changes etc.) for complete information about who was doing what, when, and why. making sure changes are perfectly documented is the base for later deploying them.
- harmony with task based development enables correlating each version control change with a change request or a trouble ticket. this enables task based deployments, partial deployments, and last minute scope changes to be coordinated between code and database.
- ensure configuration management & consistency so every development environment, branch, trunk, sand-box, and testing or production environment follows the same structure, and matching status; or any deviation and difference are well accounted for.
- scriptable interfaces, to deal with automation of deployment processes, providing repeatable results every single time. even the most sophisticated solution becomes cumbersome if you have to use the ui to do the same task over and over again.
- provide reliable deployment scripts, which are capable of dealing with conflicts and merges of database code, and cross updates from other teams; while also ignoring wrong code overrides, and are fully integrated into the version control repository.
- provide automatically generated development scripts on the fly to deal with deploying any combination of project scope, from multi-schema mega-updates, to a single task based change and its dependent objects.
- leveraging ‘labels’ (tagging of database structure snapshots and relevant content) before and after deployment of changes, to act as a safety-net, so quick and easy roll-backs are always close at hand.
- fully integratable to other systems (alm, change management / trouble tickets, build servers, and release managers).
implementing a solution to deal with these challenges would enable a company to practice proper database automation. database automation which would be easy to integrate with the rest of change and release processes, to achieve a complete end to end automation.
once automated continuous integration and continuous deployment the last two steps of automation heaven, are just a decision away from reality.
the database sets up a real challenge for automation. scripting database objects change-scripts into traditional version or using ‘compare & sync’ tools is either an inefficient or plain risky thing to automate, as the two concepts are unaware of the other. a better solution needs to be implemented in the shape of devops for database.
devops for database should follow the proven best practices of change management, enforcing a single change process over the database, and enable dealing with deployment conflicts to eliminate the risk of code overrides, cross updates and merges of code, while plugging into the rest of the release process.
Published at DZone with permission of Yaniv Yehuda, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.