Continuous Delivery Pitfalls
Join the DZone community and get the full member experience.Join For Free
[editor's note: this article is featured in
dzone's 2014 guide to continuous delivery
there is little question that continuous delivery provides a compelling business story. everyone is looking for ways to increase their own business agility with cloud-based builds, built-in unit and integration testing, and fully automated deployments, all instrumented with monitoring utilities. if there weren't several high-profile companies discussing both their continuous delivery successes and failures so publicly, it might all seem like a fairy tale. the incredible complexity of software production makes it extremely difficult to create a clean path for software to travel from a developer’s keyboard all the way to the customer’s hands.
for every one of the "continuous delivery unicorns," like etsy and netflix, there are at least ten organizations who struggle significantly to implement cd within their organization. many of those will ultimately fail entirely to deliver on cd's promises.
like any new development methodology, implementing continuous delivery has a number of pitfalls that can trip up even the most mature organizations. successful continuous delivery processes are predicated on a number of technical and cultural assumptions, and in many cases organizations don’t have the foundation necessary for cd. organizations often try to copy the practices of a company like netflix wholesale after reading some of their resources, ignoring the differences in their own products or market. these examples are just a few of the reasons why companies find themselves in trouble when adopting continuous delivery. below are four of the most common pitfalls to avoid when implementing continuous delivery.
1. attempting to build continuous delivery on top of an unstable (or non-existent) continuous integration foundation.
continuous integration is a foundational requirement for continuous delivery. the constantly referenced continuous delivery deployment pipeline is really just the practices of continuous integration extended to infrastructure management and the production environment. thus, any successful cd implementation begins with a ci system that is stable, operationalized, and able to provide actionable data. the organization should also foster a company culture that knows how to react to that data.
many environments, however, have no continuous integration currently deployed or a poor ci foundation for cd. common issues with ci infrastructures include:
operating system configuration, libraries, and tool inconsistencies between developer and build/test/production environments.
inconsistencies among ci agent configuration (despite how much it's emphasized as an issue by the devops movement, it remains a disturbingly common problem).
ci master servers or agent hosts running on individual employees’ computers or in unofficial/personal cloud accounts. this is often observed in organizations that need to support mac os x
ci masters with no access control, with job configurations that can be modified without notification or an audit trail
unactionable ci, which can be caused by insufficient communication mechanisms from the ci infrastructure (email, which everyone promptly filters for instance), or a cultural barrier, where ci errors or build/test failures are not considered by everyone in the organization to be worthy of a timely response
in the worst cases, organizations get excited about cd and try to skip over ci.
the bad news: the solutions to these problems are varied. some are simple, while others (especially those involving company culture) may be tougher to overcome.
the good news: once the organization has achieved stable, operationalized, actionable continuous integration, you’ve already done 50% of the work to build a legitimate continuous delivery environment.
2. confusing continuous delivery with continuous deployment
since continuous delivery and continuous deployment have very similar themes, it's easy to understand the origin of this confusion. continuous delivery is the discipline and infrastructure around the ability to deploy changes whenever it makes sense for the business to do so . it does not require that every single developer commit directly out to production in real-time.
getting every single improvement out to customers the moment that it is checked in is so tantalizing that business stakeholders often believe that this is the ultimate goal of continuous delivery. the metric of achieving commit-to-release for all situations starts to be overly emphasized, leading to the hawthorne effect , where people improve performance on the metrics they know they're being measured by. unfortunately, the effect is often temporary.
to emphasize the difference between continuous delivery and continuous deployment, one just has to understand that continuous delivery is possible even in low-change tolerance, high risk environments, like a nuclear power plant. in such situations, the focus isn't on continuously deploying updates to plant software and infrastructure, but rather on integrating and deploying it to staging infrastructure so that even infrequent deployments will have a higher probability of success.
to be clear, continuous deployment is not a fantasy: organizations who have long focused on their continuous delivery pipelines and processes, like etsy and facebook, do deploy changes at an attractively high rate. but for organizations starting with continuous delivery, focusing on the path commits take through the delivery pipeline, as opposed to the rate at which they're deployed, will produce better initial results and a higher chance of permanent adoption.
3. complicated or inconsistent source code workflows
continuous delivery father jez humble often conducts an informal survey during talks. he'll ask the audience to raise their hand if they do continuous integration. most hands go up. his second question: "put them down if all the devs on your team don't check into trunk/mainline/master at least once a day." many of the hands invariably go down.
this survey indicates that feature branches and complex branching/merging processes are an enemy of continuous integration, and therefore of cd. in fact, in its pure form, humble argues there is no need for any branch other than (what git calls) the master branch.
this is especially hard for users of git to accept because of its ability to easily create and publish infinite feature branches. overuse and reliance on an unmerged codeline can make code flow through a delivery pipeline difficult for anyone to track. creating release branches and other automation-related branches can quickly add complexities that make it almost impossible to answer simple questions like, "show me all the commits that are in this release, but not in the integration branch."
this doesn’t mean that git is a bad tool for cd, but users should know that complicated branching/merging and different individual workflows will make continuous delivery very difficult, regardless of the tools used.
4. attempting to switch to continuous delivery without any supporting infrastructure
the ability to deploy code to production at a moment's notice requires visibility into the state of your application. your application may require configuration management, monitoring and alarms, and rollback conditions. setting up this infrastructure is not very exciting and many times new features will get priority and investment instead of infrastructure support. this is a mistake that will make the implementation of cd more difficult.
a great example of this is mozilla corporation's move from 18+ month release cycles for its firefox web browser to six week release trains. the move required a massive investment in qa process and infrastructure, including a cultural change so that every component of the browser and every bug fixed had a comprehensive suite of unit tests, ensuring that any mistakes that would "break the web" would be easy to spot as the rate of change to the code-base increased. it required an investment in build/release infrastructure to support running all of these tests on the supported platforms and mobile devices at a scale previously not encountered.
in short, it required that the business invest heavily in infrastructure which, to put it frankly, isn't sexy and usually doesn't provide direct business value. in many software shops, infrastructure has been chronically underinvested in already, so they are already starting their cd initiative at a disadvantage. successful continuous delivery stories commonly emphasize the organization’s commitment to investing in infrastructure throughout the cd transformation and beyond.
5. difficult, but worth it
moving to continuous delivery as the release mechanism for your software is not a trivial undertaking. similar to implementing devops, it requires committed investment in new tooling and a re-examination of the organizational culture from all technical and business teams before any benefits can be gained. this can be very difficult if the cultural foundation for continuous delivery is initially unstable. it’s even harder if you’ve fallen into one of the pitfalls mentioned in this article and still believe that you’re going down the right path. it takes work, humility, perseverance, and a commitment to balancing feature development with infrastructure development. if your organization is willing to put in the extra effort to get things right, you will put your business on the path to reliably ship software any time.
Opinions expressed by DZone contributors are their own.