CD

On this page 7

CD is the DevOps practice of keeping software in a releasable state at all times by moving every validated change through an automated release pipeline. The abbreviation covers two closely related disciplines: continuous delivery, in which every change that passes the pipeline can be released with a single approved action, and continuous deployment, in which every passing change goes to production without any manual step.

In DevOps and cloud engineering, CD is the natural continuation of CI. Continuous integration proves that the code builds and passes tests; CD proves that the same build can be deployed safely, then deploys it to staging and production environments using repeatable, scripted procedures rather than hand-run release checklists.

How a CD pipeline moves a change to production

A CD pipeline takes a single immutable artifact, such as a container image or a versioned package, and promotes it through a sequence of environments. The core rule is build once, deploy many: the artifact tested in staging is byte-for-byte the artifact that reaches production, so no rebuild can introduce untested differences.

Each stage acts as a quality gate. A change advances only when automated checks pass, and any failure stops the promotion and notifies the team. The table below shows the stages found in most cloud CD pipelines and what each one verifies.

StageWhat happensWhat it verifies
Artifact publicationThe CI output is tagged and stored in a registryTraceability from commit to release
Test environment deploymentScripted deployment to a short-lived environmentThat the deployment procedure itself works
Acceptance testingFunctional, contract and integration tests runBehavior against business requirements
Non-functional checksPerformance, security and compliance scansLatency, vulnerabilities, policy rules
Staging deploymentRelease into a production-like environmentConfiguration and dependency correctness
Production releaseProgressive rollout with health monitoringReal user impact and error rates
Typical stages of a CD pipeline

Configuration is kept outside the artifact. Environment-specific values such as connection strings, feature flags and replica counts are injected at deploy time, usually from declarative configuration stored in version control. This separation is what allows one artifact to run correctly in every environment.

Continuous delivery versus continuous deployment

The difference between the two meanings of CD lies in who presses the final button. Both require the same automation, test coverage and pipeline discipline; continuous deployment simply removes the last human approval step before production.

AspectContinuous integrationContinuous deliveryContinuous deployment
ScopeMerge, build and testEverything up to a releasable buildEverything up to production
Production releaseNot coveredManual approval, one actionAutomatic on every passing change
Release frequencyNot applicableOn business demandMany times per day possible
Test coverage neededUnit and build testsBroad automated suiteVery high, trusted suite
Typical fitEvery teamRegulated or scheduled releasesWeb services with fast feedback
Comparison of CI and the two forms of CD

Continuous delivery suits organizations that must coordinate releases with regulatory sign-off, marketing dates or customer contracts. Continuous deployment suits teams that run online services, own their operations and can detect and reverse a bad change within minutes. Many teams practice delivery for some services and deployment for others.

Deployment strategies used in CD

A CD pipeline needs a release strategy that limits the damage of a faulty change. The strategy determines how traffic moves from the old version to the new one and how quickly the team can roll back. The two most common progressive strategies, blue-green deployment and canary deployment, have their own pages; the table summarizes where they fit.

StrategyHow traffic movesRollback speedMain cost
Rolling updateInstances are replaced in batchesMinutes, by rolling back againMixed versions during rollout
Blue-green deploymentTraffic switches between two full environmentsSeconds, by switching backDouble infrastructure during release
Canary deploymentA small share, often 1-10%, goes to the new version firstSeconds, by draining the canaryNeeds good metrics and analysis
Feature flag releaseCode ships dark and is enabled per user groupInstant, by turning the flag offFlag debt and testing combinations
Release strategies and their trade-offs

Mature pipelines combine these approaches: an artifact is deployed with a canary analysis step that compares error rates and latency against the stable version, and new behavior stays behind a feature flag until the business is ready to expose it. This decouples deployment from release, which is one of the most valuable ideas in CD.

Measuring and implementing CD

CD performance is commonly measured with the four DORA metrics: deployment frequency, lead time for changes, change failure rate and time to restore service. These metrics balance throughput against stability, so a team cannot improve one by silently sacrificing the other.

SituationRecommended choiceReason
Weak automated testsStart with continuous deliveryManual approval compensates for gaps
Monolith with long release cyclesAutomate deployment before splitting the systemRepeatable deploys reduce release risk first
Database schema changesUse expand-and-contract migrationsOld and new versions must coexist
Regulated environmentPipeline approvals with audit logsEvidence is generated automatically
Many independent servicesOne pipeline per serviceTeams release without coordination
Decisions when introducing CD

Pipelines are usually defined as code in the repository, using tools such as a CI server, a workflow engine or a GitOps controller that reconciles a cluster with the desired state stored in Git. The GitOps model is popular for Kubernetes because the deployed state is always auditable and reversible through ordinary version control history.

Common pitfalls in CD adoption

Most failed CD initiatives fail on process and test quality, not on tooling. The following mistakes appear repeatedly in practice:

  • Rebuilding per environment, which means production runs an artifact that was never tested.
  • Flaky tests that teams learn to ignore, which destroys trust in the quality gates.
  • Manual configuration changes on servers, which create configuration drift the pipeline cannot see.
  • Long-lived branches, which turn every release into a risky integration event.
  • No rollback rehearsal, so the recovery path fails exactly when it is needed.
  • Coupled database migrations that make an older application version incompatible with the new schema.

A useful test of genuine CD is simple: could the team safely release the current main branch right now, on an ordinary afternoon, without a release meeting? If the honest answer is no, the pipeline still has manual gaps.

The short version

CD is a way of shipping software in small, safe, frequent steps. Every time a developer finishes a change, machines build it, test it and prepare it for release. With continuous delivery, a person decides when to release it. With continuous deployment, the release happens automatically once all checks pass.

Think of a bakery that checks every loaf as it leaves the oven instead of inspecting a whole week of baking at once. Problems are caught early, each batch is small, and a bad loaf never reaches many customers. The key idea is that releasing becomes routine rather than a stressful event.

Where it makes a difference

An online booking service with twelve developers used to release once a month after a two-day manual test cycle, and roughly every third release needed an emergency fix. The team introduced a CD pipeline: each merged change produced one container image, which was deployed automatically to a test environment, checked with about 1,500 automated tests, and then released to production as a canary receiving 5% of traffic for 15 minutes.

If error rates or response times rose above the stable version, the pipeline drained the canary and alerted the team. Within a few months, the service moved to several production releases per day, each containing a handful of changes. Incidents still happened, but they were small, easy to trace to a single change and reversed in minutes rather than hours.