5 Keys to Agile Database Development
5 Keys to Agile Database Development
Just because you're working with a database doesn't mean you can't take a lesson from the Agile Manifesto. Learn how Agile practices and automation can help you out.
Join the DZone community and get the full member experience.Join For Free
Although most application developers now consider agile a mainstream approach, database developers — especially those working on relational databases — have been slower to embrace it because of the need to understand and respect the state of a database when deploying changes. Thus, database professionals have had to rely on manual processes that do not scale up to the faster development cycles at the heart of agile.
Until database development processes — particularly development of relational databases like Oracle, SQL Server, and DB2 — scale up to a similar level, they will continue to be the bottleneck in an otherwise agile organization
Relieving that bottleneck requires an automated pipeline with which database development teams can address risk, ensure quality and shorten the development cycle for the organization as a whole. Here are five keys to agile database development.
Version control plays a different role on database development projects, but it is still a valuable way of tracking data definition language (DDL) changes every step of the way. Tracking revisions to stored functions and procedures over time makes it easier to assess them, compare them side by side and diagnose any problems that arise on the path toward production.
Even if developers and QA teams are comprehensive and remember everything they need to test, manual testing is still vastly slower than automated tests that run against the code change at the point of check-in. Automated testing provides a basis and a safety net for accelerating database deployments because it offers nearly immediate assurance that new changes do not break earlier work. Furthermore, by automating and executing this process at the point of check-in, developers will receive immediate feedback about a break and be in the best position to fix it quickly, when the relative cost to fix a bug is at its lowest
Static Code Analysis
Developers subject their code to peer review to ensure that they haven’t missed something, introduced a security vulnerability, made a mistake in logic or inadvertently slowed the product down. Static code analysis software significantly accelerates this process and ensures adherence to company standards by reading the code and identifying the same kinds of patterns that peer developers look for.
Database developers, too, stand to gain from applying static code analysis after unit testing, perhaps even more than their application development peers. Given the extreme pressure and ever-tightening deadlines of the database development cycle, many teams rush the code review process or skip it entirely. Thus, automating the process at the database development level can reduce the time the team spends and increase overall consistency of code reviews. Automated code review can check against rules written to help enforce company standards and improve quality, performance, maintainability, security and flow.
Stage for Deployment
To reduce the risk of data loss and other mishaps, the database development path usually includes a DBA stop in the deployment stage for a review of code changes before they go into production. While automating around the DBA stop is not a good idea, automating the creation of ALTER scripts for deployment is a valuable step in shortening the development cycle. DBAs managing the path to deployment can use automated tools to collect all the queued changes that have passed regression tests and static code analysis, compare them to the production environment and generate the scripts to commit them. Not only can this improve DBA efficiency and shorten the development cycle, but it can also ensure all of a project’s changes make it into production. AutomationAs the organization moves away from manual processes and toward automated tools, database development cycles will start shrinking and all teams can begin to realize the promise of agile. Using software tools in a piecemeal fashion each step of the way is faster than pure manual processes, but it provides only incremental improvements. Agile requires a fundamental shift in the way teams work. Instead of having people manage each step of the process, teams must look for ways to create fully automated pipelines that submit changes to regression testing, review and staging for deployment without further interaction from the team. DBAs can rest assured that code changes meet quality standards and adhere to company policy, and managers can see that code will meet project requirements and run properly in production.
Application developers have long taken advantage of agile practices to shorten their development cycle and reduce the risk associated with change. Database development, on the other hand, has traditionally relied on manual processes that reduce the risk of data loss in a live production database. The resulting bottleneck, especially in a relational database environment, has kept the organization as a whole from realizing the full promise of agile: the ability to release software in prompt response to market change.
For application developers, database developers, and database administrators (DBAs), automation is the key to synchronizing the development cycles of application software teams and database teams.
Published at DZone with permission of Yaniv Yehuda , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.