The DevOps engineer's handbook The DevOps engineer's handbook

Continuous Delivery: Origins, 5 principles, and 7 key capabilities

What is Continuous Delivery?

Continuous Delivery (CD) is a set of principles and practices that improve software delivery speed. Its adoption leads to higher deployment rates, continual process improvement, and increased team happiness. Simply, Continuous Delivery is the best way to deliver software we know.

A Continuous Delivery pipeline automatically prepares code changes for release to production. It builds on Continuous Integration (CI) to ensure code is always deployable and uses automated testing, staging, and deployment workflows to streamline the path from development to production.

Continuous Delivery helps developers and operations teams:

  • Reduce manual tasks
  • Get faster feedback loops
  • Continuously improve
  • Iterate faster

Continuous Delivery versus Continuous Deployment: What is the difference?

People often use the terms Continuous Delivery and Continuous Deployment (both sometimes known as CD) interchangeably, but they describe different levels of automation for releasing software.

Continuous Delivery involves automatically preparing code for release, but the final deployment to production is a manual step. This practice allows software to always be deployable but gives teams the flexibility to choose when to release based on business needs, user feedback, or other considerations. The manual intervention acts as a checkpoint to confirm readiness and address last-minute concerns.

Continuous Deployment takes automation a step further by automatically deploying every successful code change to production. There are no manual steps; the pipeline handles everything from code commit to deployment. This practice allows for faster feedback and iteration.

The main differences between Continuous Delivery and Continuous Deployment are:

  • Release frequency: Continuous Delivery allows for scheduled releases, while Continuous Deployment leads to multiple releases per day as every change goes live immediately.
  • Risk management: Continuous Delivery provides a final checkpoint to catch problems before they reach production, while Continuous Deployment relies entirely on automated testing and monitoring.
  • Operational overhead: Continuous Delivery might need more coordination around releases, while Continuous Deployment needs robust automation and monitoring to ensure stability.

The Origins of Continuous Delivery

Continuous Delivery borrows some ideas from the lean manufacturing production method popularized by Toyota.

Before the lean method, car manufacturing was cumbersome and inefficient. For example, it was common for manufacturers to build cars in huge batches for anticipated demand, focus each manufacturing run on a single model to limit process changes, and only check vehicles for quality at the end of the production line.

This process hurt manufacturer agility and often resulted in waste, because production was separate to customer needs. More importantly, manufacturers would perform quality assurance at the end of the production line. By the time inspectors found faults, cars were complete and teams wasted further effort in fixing or replacing production vehicles. Sound familiar?

By adopting lean manufacturing methods, Toyota adjusted their processes so they:

  • Worked to their actual demand, building only the cars and parts needed to complete orders
  • Developed new processes to change machine setups quickly so they could react to order variety
  • Empowered their staff to stop production and solve problems if they found problems from the previous station (famously known as the Andon Cord)

The result was less risk and fewer wasted hours and materials. Plus, useful for the analogy with DevOps, they found staff more engaged in their work. In the bottom line, Toyota learned that it is much more efficient to work in small batches, Improve your processes, check quality throughout, and empower staff to solve problems. All of which are core tenets of the agile/DevOps approach to software engineering.

5 principles of Continuous Delivery

Continuous Delivery uses 5 simple principles to guide organizations in adopting it and help keep them focused on its use.

The 5 principles are:

  1. Build quality in
  2. Work in small batches
  3. Automate everything you can
  4. Always improve
  5. Everyone’s responsible

1: Build quality in

As with traditional manufacturing methods, software delivery usually places quality checks at the end of the production line.

When placed at the end, however, quality can become an afterthought. This means you might:

  • Not realize there’s a problem with your delivery processes or software until the end of a sprint
  • Waste time and effort on something that doesn’t work
  • Repeat mistakes without realizing it

Instead, you should build quality into your deployment pipeline. This means designing your deployment pipeline so it detects faults during all phases. Aim to shorten the time between a problem’s introduction and its discovery.

Once found, immediately update your processes or systems to catch the fault earlier in your pipeline or remove it completely.

2: Work in small batches

Organizations not using Continuous Delivery try to limit downtime by releasing updates together in huge batches.

While this feels like a sensible and safe option, it instead causes a lot of problems:

  • Developers must work against change windows and commit deadlines
  • A single broken update can prevent the other changes in its batch from going live
  • It’s harder to pinpoint which update breaks something
  • Rollbacks could be a long process if you can’t fix it quickly

In comparison, by working in smaller sprints and batches instead, you will:

  • Get faster feedback for your product and the effectiveness of your deployment pipeline
  • Reduce the risk of an update breaking something
  • Make rollbacks to a previous version much easier
  • Increase the predictability of releases and your confidence in them
  • Quicken each phase of your pipeline

3: Automate everything you can

Humans are not particularly great at performing repetitive tasks for a long time. People make mistakes. People get tired or bored. People get distracted.

Computers, however, are excellent at repetitive tasks and are capable of doing them as often as you need - and without coffee breaks! That’s why with Continuous Delivery, you should automate something if it’s possible to do so.

By automating, you free staff to work on things humans are great at, like problem solving, collaborating, and improving your processes.

If you’re about to start with Continuous Delivery, use established tooling to automate the following as soon as possible:

  • Code compiling, tests, and merging
  • Packaging
  • As much of your deployment process as possible

This will give you a great starting point to make gains elsewhere in improving your deployment pipeline.

4: Always improve

Though automation is an important part of improving your processes, it’s not the only thing you should focus on. Plus, tasks already automated will have room for improvement.

In particular, look for unnecessary steps or those that slow updates down as they move through your deployment pipeline.

For example:

  • Can you make an already automated process quicker?
  • Can you automate or speed up provision of infrastructure or environments?
  • If an approval step slows down your delivery, do you still need it? If so, can you automate the approval, either fully or partially?
  • If something in your pipeline fails and doesn’t affect your software delivery, do you still need it?
  • Is there tooling you haven’t considered that could improve or speed up your processes?

You should never stop asking these questions or striving to improve your deployment pipeline and its workflows.

5: Everyone’s responsible

Work culture is one of the most important things to address when it comes to adopting both DevOps and Continuous Delivery.

Continuous Delivery works best in what the Westrum Typology of Organizational Cultures calls a ‘generative’ culture.

To create a generative culture, you must encourage an environment where team members:

  • Cooperate often and reject silos
  • Share a common goal and responsibility for the product
  • Feel comfortable enough to take risks
  • Accept mistakes and failure as part of the process and do not play the blame game
  • Feel safe to speak honestly and freely

7 key capabilities of Continuous Delivery

The 5 principles help guide decision making, but there’s also technology and processes you must have in place to adopt Continuous Delivery.

Specifically, there are 7 capabilities needed for a successful adoption:

  1. Continuous Integration (CI)
  2. Trunk-based development
  3. Continuous testing
  4. Monitoring and observability
  5. Loosely coupled architecture
  6. Database change management
  7. Deployment automation

Related content: Read our guide to the benefits of Continuous Delivery

1: Continuous Integration (CI)

Traditionally, developers worked to deadlines or only committed code once they’d finished a feature. Working this way gave build managers time to compile and test their work. This was a manual and methodical process that left developers waiting for feedback and slowed down software delivery.

Instead, Continuous Integration improves commit rates and automates time-intensive and repetitive build tasks. A build platform automatically packages code for deployment. If the build fails its tests, developers know there’s a problem straight away.

The benefits are:

  • It’s easier to find and fix problems in small commits
  • Developers get almost instant feedback
  • No one’s bound by deadlines or change freezes
  • Automation’s repetition makes results more predictable
  • Everyone gets more time - developers can code without barriers, operations teams can work on more important tasks

2: Trunk-based development

Almost all software developers are familiar with ‘distributed development’ thanks to Git, and we wager most development teams already use Git repositories like GitHub or similar.

Distributed development is hugely important in modern software delivery. It allows developers in large teams to work independently in their own branches before merging into the main source code. However, Continuous Delivery still recommends setting some limits with branching with trunk-based development.

Trunk-based development is when developers either:

  • Commit code directly into the main branch
  • Use 3 or fewer branches and merge into the main branch within 24 hours

The reason for these limits is the longer developers work on separate branches, the higher the risk of merging problems. By committing to the main branch as often as possible, you’re more likely to build on the newest code and less likely to experience merge conflicts.

3: Continuous testing

We talked about testing as part of Continuous Integration, but testing doesn’t end with a successful build. Testing happens throughout your deployment pipeline and in all environments, including:

  • Usability
  • User-access testing (UAT)
  • Security
  • Post-release vulnerabilities

One truth remains with all testing: It should happen often, quickly, and—if possible—automatically. Invest in testing tools to take the load off your teams.

The structure of testing is also important. Strategically run your fastest and automated tests first. That way, if you find a problem, you haven’t wasted effort on slower or manual tests and can use that time elsewhere.

4: Monitoring and observability

For continuous Delivery to succeed, you should collect data from every possible source and use it to spot all patterns and relationships related to your delivery pipeline.

At the very least, you should track:

  • Infrastructure performance
  • Internal process times
  • Application feature usage
  • Business metrics relevant to your application

Continuous Delivery recommends pulling all those metrics into a single tool because it helps you spot relationships easier and react much faster. Plus, it can help direct your improvement efforts.

For example, you could see when a new version causes complaints by tracking software versions and support tickets in one place. Or, by tracking deployments and cloud infrastructure activity, you see the changes making your costs rise.

5: Loosely coupled architecture

‘Loosely coupled architecture’ is a development structure where teams build apps in separate components. Each component has:

  • Its own infrastructure
  • Few dependencies
  • Its own deployment pipeline
  • Its own team who can do the following without input from others:
    • Develop
    • Test
    • Deploy
    • Make decisions

Structuring an application like this means:

  • You can deliver updates much quicker as a component’s pipeline is shorter
  • Updates shouldn’t delay or impact delivery to other components

6: Database change management

Updating a database can be more disruptive or damaging than updating an application. Data changes quickly in modern software delivery and that can affect both deployments and your recovery options.

Say you remove a database column, row, or field between application versions. You could roll back to the previous version if the application update has major problems. A rollback becomes more difficult if the old version relies on the deleted information and users have already made changes.

That’s why it’s important to have strategies to help manage database changes during deployments. Your exact strategy depends on the type of application you develop.

There are 2 common strategies to help manage database changes:

Have a database for each version

This strategy involves making your app’s database read-only during deployment and making a copy. You then upgrade and change the copy for the new version. Once happy, you redirect all traffic to the new app version.

It’s important to perform each step as quickly as possible. The longer you dwell, the higher the risk of recovery.

Decouple your database changes

When there’s one database for all versions, you can use an ‘expand and contract’ pattern to limit upgrade problems.

With this method, you can add to the database without impacting your application. The downside, however, is you can’t remove anything unless no running version depends on that information. The pattern involves making a small change to the database, deploying, then repeating these 2 steps until complete.

7: Deployment automation

Deployment automation helps you deploy more often and reliably, with the same packages and processes throughout a version’s lifecycle.

By automating your deployments, you achieve reliability through repetition. There should be no surprises deploying to production if you already successfully deployed to dev and test.

Automating your deployment processes also helps you avoid human error. You’ll never miss steps or do them out of order. Plus, different teams can trigger deployments and not worry about making mistakes.

Learn more in our detailed guide to Continuous Delivery in Agile.

Deployment pipelines

A deployment pipeline is the mechanism to get a developer’s commits to environments.

A deployment pipeline uses the following tooling:

  • Build server or CI platform
  • Packaging service
  • Deployment software

If you want to learn more about deployment pipelines read What is a deployment pipeline.

What are Continuous Delivery tools?

Continuous Delivery (CD) tools are components in the software development pipeline that automate and streamline processes. Continuous Delivery tools exist to help manage many functions, from integration and testing to deployment and monitoring and help teams maintain high standards of code quality and delivery efficiency.

Key features of Continuous Delivery tools include:

  • Deployment automation: Automates software releases to various environments, ensuring consistent and reliable deployments.
  • Scalable pipelines: Scalable pipelines: Supports scaling of build and deployment pipelines to handle increased workloads and larger projects.
  • Infrastructure as Code (IaC): Manages infrastructure configurations through code, ensuring consistency and allowing for easy replication of environments.
  • Real-time monitoring: Tracks application performance and system behavior, providing insights to detect and resolve issues quickly.

Further reading about Continuous Delivery

Continuous Delivery is popular because it’s statistically proven to work. You can measure how well your company uses Continuous Delivery with established frameworks and metrics. Use the following resources for guidance:

For more information, read our Measuring Continuous Delivery whitepaper.

Learn more in our detailed guide to Continuous Delivery vs Continuous Deployment.

Continuous Delivery with Octopus

At Octopus Deploy, we’re all about making Continuous Delivery (CD) easier and faster for software teams. Over 4,000 companies worldwide count on us for CD, GitOps, and release orchestration to deliver value to their customers quickly. Whether it’s modern containerized apps or older systems, Octopus seamlessly handles software delivery across multi-cloud, Kubernetes, data centers, and hybrid setups. We’re also big on governance, risk, and compliance (GRC), helping Platform Engineering teams enhance the Developer Experience (DevEx).

Find out more or start a trial to see how it works.

Get insights into the culture and methods of modern software delivery

Sign up for our fortnightly Continuously Delivered email series to learn from our experiences with Continuous Delivery, Agile, Lean, DevOps, and more.

Sign up

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Categories:

Next article
Benefits of CD