DevOps and Continuous Delivery to Accelerate Flow
local graph
Chapter 8 — DevOps and Continuous Delivery to Accelerate Flow
Section titled “Chapter 8 — DevOps and Continuous Delivery to Accelerate Flow”Lean is about constant ticking, not occasional kicking.
– Alex Miller, Professor of Management at the University of Tennessee
Chapter 7, Technical Agility with Patterns and Techniques, explained technical excellence and focused on patterns and techniques for attaining technical agility. This chapter focuses on DevOps and automation, which is the second segment of technical agility.
DevOps has gained significant momentum in the last few years and fueled success for many enterprises. Adopting a DevOps culture in software development and operations is increasingly necessary to deliver reliable systems faster through better collaboration and operational excellence. Continuously delivering value with a substantially high velocity with quality and flawless solutions demands a considerable amount of automation, similar to that in the manufacturing industry. Like a conveyor belt in manufacturing, in which goods pass through different stages, a fully automated delivery pipeline transfers source code immaculately through several pre-configured processing steps, such as building, validating, deploying, and releasing into a production environment, making it accessible to customers. Architecting to enable incremental builds, frequently repeated testing, zero-downtime deployments, and progressive releases to customers is incredibly important to successfully adopt DevOps and continuous delivery.
This chapter explains the importance of DevOps and DevSecOps culture and discusses other concrete practices of DevOps concepts. We will also discuss the idea of continuous delivery pipelines and explain the techniques and patterns relevant to continuous integration, automated deployment, and releasing on demand. We will also discuss the importance of security by design in delivering secure applications.
In this chapter, we’re going to cover the following main topics:
- Embracing DevOps culture
- Enabling flow with continuous delivery
- Adopting continuous integration
- Automatically deploying to production
- Releasing on demand
- Securing systems by design
Thoughtfully integrating full stack telemetry into the continuous pipeline ensures the systems and services deployed are measurable against agility and stability. Delivering security-hardened and battle-tested systems against possible attack vectors without adversely affecting the speed of delivery needs careful architecture considerations for the early detection and rectification of security vulnerabilities, including the automatic patching of zero-day exploits.
This chapter focuses on the DevOps and Continuous Delivery focal point of the Agile Architect Lens:

Figure 8.1 – The DevOps and continuous delivery focal point
Embracing DevOps culture
Section titled “Embracing DevOps culture”As articulated at https://devops.com/, DevOps was first introduced by Patrick Debois as a concept to get rid of the wall of confusion and lack of cohesion between development and operations teams. In traditional software delivery practices, developers used to throw code over the wall to the operations teams for deployment and operations. DevOps annihilated the walls of confusion by aligning development and operations teams’ efforts, visions, and capabilities to produce valuable outcomes for businesses and customers.
The following diagram illustrates how DevOps avoids traditional handoffs:

Figure 8.2 – Traditional approach of development and operations versus DevOps
With the Wall of Confusion, deployment teams without enough knowledge of the workload lose opportunities for optimization, resulting in suboptimal and erroneous deployments. DevOps breaks this wall by establishing strong ties between development and operational teams. The DevOps concept, anchored around collaboration, automation, and speed of delivery, is adopted by implementing team topologies, automating processes, and adopting modern technology practices.
The cloud infrastructure advancement is increasingly moving toward a software-based approach that enables developers to handle infrastructure like any other software. On the other hand, system admins are trying to acquire application knowledge to keep them relevant. DevOps needs a radically different culture by adopting lean-Agile principles to create a shared responsibility between development and operations teams to build, test, deploy, and operate systems that continuously deliver the maximum possible value to customers with a minimum lead time.
Jez Humble introduced the CALMS principles for DevOps. These five foundation principles are expanded and explained as follows:
- Culture: Faster delivery of high-quality secured solutions is the responsibility of everyone in the team with no siloed thinking or conflicts of objectives.
- Automation: Automating the delivery pipeline removes toil and makes the flow more predictable, reliable, and repetitive.
- Lean: Avoiding flow barriers by relentlessly focusing on eradicating wastage such as handoffs and wait times reduces reject cycles and improves lead times.
- Measurement: Continuously collecting signals from observable systems to build information radiators helps to determine areas for improvement.
- Sharing: Dev and ops teams communicate transparently and collaborate frequently with a sense of purpose.
Architects enable and foster DevOps culture with lean Agile leadership and enable a continuous flow of values by architecting modular, secure, and reliable solutions that are incrementally testable, deployable, and releasable.
Scaled Agile Framework (SAFe) uses a slightly different definition of CALMS by replacing S with R for recovery. Building automated recovery mechanisms to roll back and recover from unexpected deployment failures is substantially important for high-throughput deployments.
Over time, DevOps practitioners realized the importance of blending security into DevOps, which resulted in DevSecOps. The next section elaborates on the concept of DevSecOps.
Enhancing security with DevSecOps
Section titled “Enhancing security with DevSecOps”Security is substantially important for any business since compromising security can lead to severe damage. A critical data breach can bring enterprises to a grinding halt. Hence, security cannot be traded for functional features, cost, and speed of delivery.
In large enterprises, cybersecurity is rightfully one of the most powerful departments empowered to stop projects from going live if not aligned with security guardrails. Security is by far the most critical non-functional aspect of any software system. Traditional stage-gate security validations only work well for systems and services with a slow release rate, and can adversely impact the lead time of projects having high-velocity releases.
DevSecOps is the next evolution of DevOps practice. DevSecOps introduces security as code into day-to-day programming and delivery practices by shifting security concerns to the left of the delivery cycle to earn time and cost savings. In DevSecOps, every team member, including cybersecurity members, has to have a shared responsibility to ensure they collaborate with less friction to develop secure applications without compromising the speed of delivery or customer satisfaction.
In Agile software development, security engineers are integral parts of the DevOps team. However, the federation of security engineers across every team is infeasible at scale since security engineers are scarce resources and cost more. Upskilling developers on secure coding practices and the automation of soft gate security validations to the extent possible is ineluctable to achieve consistent adoption of security policies and practices across the organization.
In DevSecOps, security is not just coding; it needs to be baked into the architecture and design as well. Fundamental principles of DevSecOps are the following:
- Security coding, testing, and fixing are done by the development team.
- Security needs and concerns are consistently added to the backlog.
- Security failures discovered are recorded in the backlog as technical debt.
Every member of the team assumes the responsibilities of developing secure applications, including architects. Architects play a vital role in architecting and designing security as a primary citizen.
Site reliability engineering is a practice overlapping with many DevOps practices. In the next section, we will take a closer look at site reliability engineering.
Crossing over with site reliability engineering
Section titled “Crossing over with site reliability engineering”Site Reliability Engineering (SRE) is a software engineering approach practiced extensively at Google. SRE practice takes an engineering approach to deploying and operating reliable software systems by employing people with a strong engineering background with a deep understanding of the system’s internal designs. Along with their design knowledge, their problem solving and analytical skills with operations experience make them a perfect candidate for managing system operations most efficiently and effectively. While development teams focus on building new features, SREs complement that with an operational and reliability view of the system.
While DevOps is an umbrella term for bringing about a collaborative culture between development and operations, SRE practice is a real implementation of DevOps philosophies. Since SREs are part of the development team and understand the application design much better, they help the development team to deploy and operate applications with operational excellence. While DevOps focuses on automation as the primary purpose, SREs focus more on highly available and reliable system delivery in which automation is just one element.
SREs take a risk-based approach to implementing technical aspects of the system, following a similar approach to the Risk- and Cost-Driven Architecture (RCDA) – if there is no risk, no improvement is required.
With Snow in the Desert, every Agile Release Train (ART) consists of a system team responsible for supporting feature teams with infrastructure, the automation of delivery pipelines, and validating system quality. The following diagram illustrates the concept of system teams:

Figure 8.3 – System and enabler teams at Snow in the Desert
The system team follows SRE practices, including infrastructure, security specialists, and other specialist support roles. As shown in the preceding diagram, there is also an enabler team for every ART. The enabler team is short-lived, joining the ART with a particular mission, such as operationalizing new toolsets for bootstrapping automated delivery pipelines. Once operationalized, they return. They work with the principle of build-operate-transfer (BOT).
While DevOps has a broad spectrum of principles and philosophies, continuous delivery practices define much more tangible principles and practices to rapidly deliver value. The next section elaborates on continuous delivery patterns and practices.
Enabling flow with continuous delivery
Section titled “Enabling flow with continuous delivery”One of the Agile Manifesto principles is to satisfy the customer through early and continuous delivery of valuable software. Adopting lean-Agile development practices alone is insufficient to accelerate the flow of work; build-test-deploy-release cycles must equally be lean and continuous. Continuous delivery is one of the underpinning practices in DevOps for automating build-test-deploy-release cycles.
CI and CD are common abbreviations used in the context of Agile software delivery and DevOps. CI stands for Continuous Integration, and is well understood as an evolution of engineering practice that automates building, testing, packaging, and deployment. On the contrary, CD is a confusing term. In general, CD is interchangeably used for continuous delivery or continuous deployment. The recent state of DevOps report Accelerate: State of DevOps 2019 defines Continuous Delivery as CD and that is adopted in this book.
The following diagram illustrates various terminologies related to the automation aspect of DevOps:

Figure 8.4 – Continuous integration, delivery, and deployment
As shown in the diagram, the end-to-end CD pipeline is broken down into three major components, as follows:
- Continuous integration: Run an integrated build, package the artifact, deploy it into various pre-production environments, and perform validations.
- Automated deployment: Packaged, validated, and hardened artifacts are deployed into the production environment with a dark launch.
- Release on demand: Make new features already deployed to production available to customers.
CI automates the first phase, covering building, testing, and, to some extent, deployment. Continuous delivery connects build, integrate, test, deploy, and release cycles in an end-to-end pipeline. At the end of every stage, work items are pushed to the subsequent stage automatically without manual interventions. On the other hand, continuous deployment replaces push with a manual pull for the last mile of moving work items to a production environment.
CD is a lean practice of automating the path to production from building, testing, configuring, deploying, and releasing with a minimal sustainable lead time. CD moves innovations, incremental code, configuration changes, and bug fixes to production in minutes by eliminating wastage, minimizing risk, and ensuring quality with almost no human touches post-development.
Disciplined Agile (DA) observes that CD is best suited when stakeholders need solutions on a frequent and incremental basis, the frequency of changes is often, and organizations have streamlined deployment practices and procedures and there is good maturity in terms of DevOps practices.
When CD is implemented properly, it can bring many benefits to Agile enterprises. Now let’s explore some of the critical benefits of CD.
Benefiting from CD
Section titled “Benefiting from CD”Embracing CD brings several benefits in enabling a faster, uninterrupted flow of values, as captured in the following points:
- Reduced lead time and costs: Eliminating handoffs with automation enables a faster continuous flow of values, resulting in lower resource costs.
- Predictable: Fully automated CD pipelines enhance the predictability of system behavior in production.
- Lower risk: Frequent commits, incremental builds, continuous integration of code, and automated execution of test cases substantially reduce the risk of failure.
- Better quality: Automated tests with fast and frequent feedback cycles enhance the quality of products.
Together with Agile software development practices, CD substantially enhances organization agility. But to derive the best out of CD pipelines, systems have to be architected in a certain way. The next section explains this further.
Architecting for continuous delivery
Section titled “Architecting for continuous delivery”CD goes far beyond the automation of builds, deployments, and releases of software systems. Architectural choices significantly impact the degree of automation possible and the true value proposition of automation. Patterns and practices discussed in the previous chapter, such as vertical slicing and microservices, are instrumental techniques for achieving small, independent, and incremental builds, deployments, and releases. The IEEE paper Architecting Towards Continuous Delivery, by Lianping Chen, observes that in addition to traditional quality attributes, several other attributes are influential when architecting for CD, such as deployability, security, logability, modifiability, monitorability, and testability.
In addition to architecting solutions for CD, architecting the pipeline itself is incredibly important. Some of the considerations are as follows:
- Thoughtfully invest time in designing the right-fit extendable CD pipeline by identifying and organizing steps specifically needed for a given system.
- A strong release management strategy, solid version control, and well-managed dependencies are critical.
- Determining bottlenecks by measuring efficiency and resolving root causes by continuously redesigning and adopting the right technologies are key to success.
- Integrating automated compliance checks for architecture, security, and other system quality attributes considerably improves the speed of delivery and quality.
- Fostering continuous collaboration between the various teams involved in the CD pipeline is one of the key responsibilities of an architect as a technical leader.
There is no one-size-fits-all solution for implementing a CD pipeline. Investing time in designing a suitable CD pipeline with progressive enhancement is essential for sustainable delivery.
Now that we have learned the importance of architecting for CD, we will now examine different parameters for measuring the success of continuous delivery.
Measuring the effectiveness of continuous delivery
Section titled “Measuring the effectiveness of continuous delivery”Measuring the efficiency of CD is significant in determining areas of challenges and progressively refining it to achieve better results. Software Delivery and Operational (SDO) performance defined by the Accelerate: State of DevOps 2019 report suggests four measurement parameters for the betterment of CD, as follows:
- Lead time for changes: The length of the pipeline time is measured as the time taken between a code commit and successfully running that feature in production.
- Frequency of deployment: Measured as the number of change releases of a particular system or service to its intended customers in a given timeframe.
- Time to restore: Measured as Mean Time To Restore (MTTR) after a failure that impacted users.
- Change failure rate: Measured as the percentage of successful versus failed deployments in production.
Measuring against these four parameters helps to understand two broad levels of KPIs – the throughput of the delivery process and the stability of the deployment. The report also highlights that these are not trade-off parameters, but are equally important outcomes.
It is straightforward to implement CD for greenfield applications but much harder for legacy applications. The next section throws some light on how to manage CD in legacy applications.
Implementing continuous delivery for legacy applications
Section titled “Implementing continuous delivery for legacy applications”CI and CD adoption are significantly painful with monolithic legacy applications. Even though the size, complexities, dependencies, and legacy nature of the technology stack hinder efforts to automate fully, it is still possible to substantially improve delivery throughput and stability by adopting relevant strategies of CD. In the research paper An Empirical Study of Architecting for Continuous Delivery and Deployment, the authors observe that monoliths and CD are not intrinsically oxymoronic. There are many effective approaches for embracing CD for legacy systems.
A few key strategies for adopting CD for legacy applications are as follows:
- Adopting a highly customized CD approach, tools, and technologies for automation
- Consistently testing interfaces by treating the system as a black box
- Adopting infrastructure as code for deployment automation
- Externalizing configurations from code
- Incrementally automating test cases for functional and non-functional requirements
- Adopting containerization strategy for applications where this facilitates deployment and maintenance
Continuously measuring effectiveness based on the lead time for changes, the frequency of deployments, the time to restore, and the change failure rate is helpful in determining further improvement areas. Gracefully adopting CD practices with a test, learn, and improve cycle is a better approach for legacy applications. Consistently measuring the complexity of code and progressively decoupling the architecture of various subsystems can further improve stability and throughput.
We have learned the purpose and benefits of CD in Agile software development. Subsequent sections explore different aspects of CD in detail, starting with CI.
Adopting continuous integration
Section titled “Adopting continuous integration”CI, originated from extreme programming, is a natural extension of development practices for constantly building, integrating, and validating code automatically. Providing feedback to developers on the risk associated with the integration as early as possible helps to fix integration and quality problems with minimal impact on the speed of delivery. CI is the first step in the CD process. The traditional approach of infrequent manual builds and integrations is no longer viable for high-velocity developments and deployments. The manual build-integration-test-correction cycle significantly impacts the continuous flow of work.
A typical CI process flow is depicted in the following diagram:

Figure 8.5 – Continuous integration pipeline
A Developer continuously commits code in a shared Source code repository that triggers the CI pipeline. Adopting pre-commits eliminates faulty code moving to the code repository. Quality assurance routines are automatically performed against the new build, ensuring the packaged artifact meets desired quality conditions. The CI pipeline also publishes the validated artifact to a central Artifact repository. The final stage of CI is to provision and deploy newly published packages to one or more pre-production environments. Some organizations use CI only for deploying artifacts to an integration server and leave other deployments to an automated deployment function. CI is based on the philosophy of build once, deploy many times to ensure that packaged artifacts are consistent across environments.
A well-architected CI pipeline offers the following benefits:
- The flexibility to execute tasks sequentially and in parallel
- Scalability to handle a large code base
- A low footprint and optimal resource utilization
- High performance and a shorter CI cycle time
- It’s easy to provision and configure a pipeline for new systems and subsystems
- End-to-end monitorables and notifications
- Pluggability support to include additional processing steps
Teams also check-in configurations and infrastructure as code to the shared source code repository for the CI pipeline to use. Monitoring and securing pipelines is also critical for efficient CI implementation.
Large-Scale Scrum (LeSS) observes that CI is not just automating builds and running tests; it includes a set of practices such as Test-Driven Development (TDD), small incremental changes, frequent integrations, fast feedback cycles, and trunk-based development.
A good CI pipeline starts with better development and source code management practices. We will cover this in the next section.
Improving development and source code management
Section titled “Improving development and source code management”Enterprises can further scale the value of CI by adopting good development and source code management practices. Clean coding practices were explained in the previous chapter, together with pair programming, peer code reviews, and good development practices. Using IDE-based code analyzers, executing functional and performance unit test cases, testing integrations with test doubles, and committing code often adds further value.
A sophisticated, shared source control system such as Git, with an effective branching strategy, is essential for efficient source code management. There are two key repository management strategies that are popular – Monorepo and Multirepo, as shown in the diagram:

Figure 8.6 – Multirepo versus monorepo
In the case of Monorepo, multiple projects share the same repository by maintaining dependencies between each other. This approach offers a consistent developer experience with real-time change awareness as it can quickly identify whether changes break another project and reduce dependency management overheads. Multirepo, on the other hand, isolates project code with separate source code repositories with no build-time dependencies.
Many large organizations effectively make use of monorepo. However, considerable efforts are required to build tooling around monorepo to reduce associated complexities, such as too many branches and pull requests. It also needs higher degrees of team maturity to eliminate potential chaos. Complex enterprises and product companies with heterogeneous applications may choose multirepo over monorepo to manage their products better. Monorepo requires significant discipline as accidental mistakes can lead to unexpected errors in fellow developers’ code. It can also cause adoption and performance challenges, such as slowness in downloading the full code base. There is no one-size-fits-all strategy; therefore, careful analysis is necessary when selecting a repository strategy.
Choosing the right branching strategy is also significantly important when implementing CI. There are two branching strategies, as shown in the following diagram:

Figure 8.7 – Trunk-based and feature-based development
In your feature branch strategy or GitFlow, create a long-living branch for every new feature and merge it back to the trunk only when development is completed, as shown on the bottom side of the Trunk line in the preceding diagram. This approach induces minimal dependencies between different feature teams. However, feature branching strategy leads to complex and time-consuming merges using pull requests.
Trunk-Based Development (TBD) scenarios avoid long-living feature branches that complicate build systems over time. Instead, TBD recommends that developers commit directly to the trunk or use short-lived feature branches merged within a day or two with or without using pull requests.
There are advantages and disadvantages to both branching strategies. Feature branches are better if the release frequencies are longer, features are less dependent, and features are not released together. If the application is well modularized with minimal dependencies between modules and the release frequencies are very high, trunk-based development is better. Product maturity may also play a role in adopting the branching strategy. Teams might use TBD in the initial stages before migrating to feature branching as they gain stability and become established on the market.
Snow in the Desert uses monorepo as well as multirepo. All legacy applications are on multirepo, whereas new microservice developments use monorepo but are confined to certain business boundaries. Similarly, Snow in the Desert uses a combination of trunk-based development and feature branch strategy. Most old systems continue to use feature branching strategy with long-lived feature branches as releases are less frequent. Modern applications such as the B2C online frontend use trunk-based development.
In addition to good development practices, good testing practices are also equally critical for the success of CI, which we will look at next.
Automating quality assurance
Section titled “Automating quality assurance”Automated testing is a fundamental aspect of CI that enables repeated predictable releases that improve quality and stability. Automatic testing includes unit, functional, integration, security, and other types of testing. Repeatedly executing regression test suites increases developer confidence and protects from unstable code flowing into production.
The pipeline also automates architecture and quality tests such as performance, security, coupling, complexity, and dependency. Using environments that are correctly sized is essential to get realistic results. Failure trails and antifragility checks using approaches such as Chaos Monkey ensure the resiliency of systems. Test data management, writing independent test cases, and adopting service virtualization with test doubles such as mocks, stubs, and fakes are also essential considerations for automating tests.
Building a rigorous testing culture is important for the success of automated testing. Continuous automated testing frees up resources, improves consistency, and creates psychological safety.
So far, we have gone through CI, which is the first step of CD. The next section will elaborate on automated deployment.
Automatically deploying to production
Section titled “Automatically deploying to production”Automated deployment is a mechanism for continuously deploying systems and services to production without downtime. An automated deployment pipeline kicks off when CI completes successfully and further deploys artifacts from the artifact repository to a target production environment silently – also called dark mode. Automated deployments use immutable infrastructure concepts with infrastructure as code for deployment.
Continuous deployment also includes provisioning and configuring required environments using infrastructure as code before deploying the system. By fully automating production deployments at scale bring an incredibly high degree of consistency, repeatability, and protection from disruptive failures. Some organizations extend their CI tools to perform automated deployments, whereas others use different tools integrated with CI to execute deployments. Smaller changes and high-frequency deployments such as feature-based micro deployments are best practices to handle the efficiency of automated production deployments. In the event of failures, automatic rollback routines revert and restore the deployments back to a stable state to provide uninterrupted services.
There are different techniques for deploying to production without impacting customers. One such technique is dark mode deployment, which we will discuss next.
Launching in dark mode for early feedback
Section titled “Launching in dark mode for early feedback”A dark launch is a common technique used for deploying and testing applications in production silently. Dark mode deployments help development teams to deliver faster without compromising the stability of production systems.
In many organizations, the release frequencies may not be high, and businesses usually wait for the right time to release certain features. However, the development team can decouple releases from deployment and continue to deploy and test solutions in production using an automated deployment pipeline without making them available to customers. Feature flags and blue-green deployments are useful for dark launches without disrupting the production environment. Dark launches allow a subset of users, primarily development teams and business users, to access and validate new releases.
A feature flag is another technique for deploying applications silently to production. The next section will cover how developers can use feature flags.
Using feature flags to release features selectively
Section titled “Using feature flags to release features selectively”A feature flag is a mechanism for contextually determining the control flow of programs at runtime based on toggles to determine releasable and non-releasable features. Feature flags are the foundation for dark launches and progressive releases.
The following diagram shows the use of feature flags:

Figure 8.8 – Illustration of feature flags
As shown in the diagram, based on the toggle state, the flow of control goes to the new feature or uses existing features.
Enterprise-scale feature flag solutions provide a central dashboard to manage and monitor feature flags easily and efficiently with a high-performing architecture. The use of feature flags needs to be really controlled to avoid the proliferation of uncontrolled feature flags, which results in higher degrees of technical debt. One way to manage feature flags is to set an expiry date for each feature flag and attach test cases that validate and fail on expiry. Another approach for managing feature flags is adding compensating technical debt in the backlog to remove corresponding feature flags. Feature flags are also useful for managing the progressive enhancement of databases for deploying with a blue-green strategy for uninterrupted services.
Blue-green deployment is another pattern to deploy new releases rapidly to production without interrupting existing services, as shown in the following diagram:

Figure 8.9 – Blue-green deployment
Blue-green presents two identical production environments where new code is deployed to a freshly provisioned green environment. The green environment is then used for sanity tests, chaos tests, system quality tests, user experience tests, and so on in production. Most of these tests are conducted automatically as part of the deployment pipeline. Full stack telemetry is used for monitoring failures and rectifying them before pushing users to green. Blue-green deployments also enable automatic recovery from unexpected failures.
Architecting systems for automatic and feature-based deployment is critical for releasing stable and reliable software to customers with rapid fix forward cycles. Implementing and managing feature flags at scale needs architecture thinking to avoid the diffusion of feature flags. Using the right architecture patterns and technologies such as statelessness, the cloud, and containers enables blue-green deployment.
So far, we have covered the first two phases of CD – continuous integration and automated deployment. The next section covers release on demand, which is the last phase of CD.
Releasing on demand
Section titled “Releasing on demand”Release on demand is proposed by SAFe to decouple deployment from the actual release of software to customers. Continuous deployment pushes the software into production without making it widely available to customers for regular use. The time between deployment and release is the window of safety to ensure customers get stable features from the moment it is released.
In most cases, the time of release, what to release, and whom to release to are business decisions based on market events and milestones. Delineating deployment from release elevates the business confidence to go to market with release announcements as the features are already available and are tested in production.
During the window of safety period, the development team and business users test deployed features functionally and non-functionally, release them progressively to a smaller subset of users, collect their feedback, and make necessary refinements before releasing them to broader users.
Progressively releasing with canary releases
Section titled “Progressively releasing with canary releases”A canary release is one of the release strategies for the progressive rollout of new software to reduce the risk of early feedback from real customers. The following diagram explains the approach for a canary release:

Figure 8.10 – Canary release for a selected user community
As shown in the diagram, traffic is routed to the new software, with an additional bar on the screen version, progressively to a subset of users selected based on candidate user selection strategies. The candidate user selection strategies could be random samples, internal users, premium users, market-based, and so on. Usually, collecting feedback is one of the key constraints when choosing the right canary user segment. Typically, the canary starts with a set of change agents, approximately 2-5% of the overall user base. There is a little difference between dark launches and canary releases as canary releases mainly target an informed community. In contrast, dark launches are generally restricted to internal users and might not be released to actual customers.
In addition to canary style releases, enterprises also use A/B testing for collecting early feedback on innovative changes before mass release. We will see more on A/B testing in the next section.
Collecting early feedback with A/B testing
Section titled “Collecting early feedback with A/B testing”A/B testing or split testing is another release strategy to get quick feedback primarily for experimental features, as shown in the following diagram:

Figure 8.11 – A/B testing or split testing
In A/B testing, the old version of a feature and the new version of the same feature are available for different sets of customers, either the full user base or a selected user base. The data captured from user interactions is compared to understand and determine the effectiveness, such as the new version’s user experience over the old version’s. As shown in the preceding diagram, user experience – measured by the time taken to place an order when using a Search to order transaction, is captured across old (A) and new (B) before releasing B to a broader set of customers.
To get the true value of release on demand, architects need to pay attention to the architecture and design of systems and services. In the next section, we will review some of the key design elements.
Architecting for release on demand
Section titled “Architecting for release on demand”Architecting for operations is an incredibly important factor for release on demand. Architects have to ensure the architecture of the system or service is designed to support the following points:
- Progressively releasable: Incrementally deployed services and system components are progressively releasable based on one or more release strategies.
- Testable in production: The system and services are testable in production to avoid unexpected faults post-release.
- Full stack telemetry: Adequate monitoring and analysis are in place during progressive release to ensure facts are collected and made available for decision making.
- Running costs monitoring: Ensure the implementation of cost monitoring to validate the utilization of the infrastructure to avoid a cost overrun.
- Recoverability: In case of failure during the window of safety, deployments are easily recoverable without hindering entire users.
So far, we have covered different aspects of CD and CI, automated deployment, and release on demand. A critical facet of software delivery is securing services and systems released to production. In Agile software development, security needs a radical rethink. The next section further explores securing systems by design.
Securing systems by design
Section titled “Securing systems by design”Security is a significantly important pillar applicable across all phases of CD. In this section, we will review the security aspects of CD in detail.
DevOps and Agile software development often trade off security for speed and agility, steering off course from the significance of delivering secure applications. Enterprises adequately protecting assets by implementing built-in security controls with a security-aware mindset is paramount in precluding data, revenue loss, and brand reputation damage.
Historically, cybersecurity departments held the responsibility and authority to enforce and govern software development security concerns to safeguard an organization’s intellectual property. However, the traditional stage-gate-based modus operandi of cybersecurity departments is far too complex, manual, and time-consuming. Therefore, traditional security approaches induce significant time delays and struggle to cope with the faster development and high-frequency release cycles of Agile software development. Cybersecurity departments thus need a radical transformation to reposition them from flow stopper to enabler of agility.
In Agile software development, security needs to be an integral part of the continuous flow of work with a shared responsibility to deliver secure applications faster to meet customer needs. To enable faster delivery, security engineers with a lean-Agile mindset need to adopt a shift-left pattern to apply security controls with the right set of modern tools and techniques. The shift-left pattern introduces security testing such as penetration testing and vulnerability tests earlier in the life cycle of the software development process. Detecting defects early reduces the time needed for code-test-deploy cycles.
In Agile, security is continuous and spans across architecture, development, the CD pipeline, and operations. Security controls are identified, developed, and tested by the team themselves, including fixing any deviations.
Several characteristics of security-aware teams are explained here:
- Security activities as backlog: In Agile, there is no free lunch; all work must be captured in the backlog, including security. Transparently managing security as part of the backlog helps to plan and execute security activities as part of the flow. Security validation errors, feedback, and risks have to be pushed to the backlog for prioritization.
- Code security: Cybersecurity must educate development teams on secure coding practices to consider security as a first-class citizen. Teams consciously upskill on new security developments by referring to industry practices such as the Open Web Application Security Project (OWASP) to understand various security threats. Static and dynamic code analyzers and code review tools automatically enforce standards and best practices to improve the efficiency, speed, consistency, and effectiveness of code security. Software Composition Analysis (SCA) can identify potential vulnerabilities of open source libraries.
- Architecture security: Using a lightweight and continuous approach for threat modeling by identifying threat boundaries is a significantly important activity for architects to identify the right security architecture that protects systems from internal and external attacks. Reducing the attack surface, securing APIs, encrypting message exchange, promoting security by design practices, and using appropriate compliance tools are mechanisms to help architect secure applications.
- Infrastructure security: Automating security policies as part of infrastructure as code integrated with the CD pipeline eliminates potential human errors in the infrastructure security configurations. Adopting network segmentation with the principle of least privileged access, integrating centralized identity and access management, consistent processes for automating security patches for vulnerabilities, and continually monitoring the production environment for security threats are great practices for operating secure systems. Well established and integrated process loops for fixing code based on learning from attacks enable organizations to be adaptive.
- DevSecOps practices: A mindset of shared responsibility across all team members is critical in developing secure applications. Automated and continuous scanning to detect vulnerabilities in code, infrastructure, and libraries as part of the delivery pipeline helps to find potential vulnerabilities at the earliest opportunity. In cases where automated testing is not possible, security experts must be embedded in the team to ensure there are no considerable delays in the delivery flow. Rightfully including constraints in the Definition of Done (DoD) and acceptance criteria specifically for security scenarios helps avoid critical segments of code going to production without sufficient security controls.
Architects play a critical role in ensuring adequate security considerations and good practices are followed by constantly engaging with the team. Trading off security and speeding up feature development to satisfy immediate customer needs can have far-reaching consequences on customer confidence.
Summary
Section titled “Summary”As we learned in the previous chapter, the second segment of technical agility is DevOps and automation – a combination of embracing DevOps culture and implementing CD. DevOps is a culture that brings development and operational teams together without the wall of confusion. DevSecOps is an evolution of DevOps that instills security thinking into every step of Agile software delivery.
In this chapter, we saw that CD is a delivery practice to automatically move new features, improvements, and fixes to production by reducing the lead time and improving predictability. Consistently practicing CD dramatically improves the throughput of delivery and stability of systems and services. CD practice consists of CI, automated deployment, and release on demand. CI is a natural extension of development that helps to build, test, and deploy applications to one or more environments.
Next, we understood that automated test packs consolidate unit, functional, non-functional, and integration testing as part of the CI pipeline. Automated deployment pushes successfully tested packages to production in a dark mode using blue-green deployments without activating new features for customers. Such dark deployments utilize feature flags to validate features in production before releasing them to customers. Release on demand releases features progressively to customers using practices such as canary releases and A/B testing. Architecting for CD needs special considerations to enable an incremental build, automatability, testability, and deployability. Lastly, we saw that security is a substantially important activity in the CD practice that spans across all stages of pipelines. Security in DevSecOps and CD is a continuous process all team members are responsible for.
In this chapter, we have covered the second segment of technical agility – DevOps and automation. In the next chapter, we will continue to explore technical agility by focusing on the built-in quality aspect.
Further reading
Section titled “Further reading”- History of DevOps: https://devops.com/the-origins-of-devops-whats-in-a-name/
- ACM computing survey: https://arxiv.org/pdf/1909.05409.pdf
- State of DevOps 2019 report: https://services.google.com/fh/files/misc/state-of-devops-2019.pdf
- Site reliability engineers: https://landing.google.com/sre/
- Continuous delivery:https://martinfowler.com/bliki/ContinuousDelivery.html
- Continuous delivery: https://continuousdelivery.com
- An empirical study of architecting for continuous delivery and deployment https://www.researchgate.net/publication/327536527
- Towards architecting for continuous delivery: https://www.researchgate.net/publication/280776459