Continuous Delivery vs Continuous Deployment
Once every change is integrated and tested, the next question is how it reaches production. The two answers differ by one step:
continuous delivery: commit → CI → staging → [a person clicks "deploy"] → production
continuous deployment: commit → CI → staging → automated checks → productionIn continuous delivery, the pipeline produces a release candidate that is always deployable; a person decides when. In continuous deployment, the decision is automated: if every gate passes, the change goes out.
| Continuous delivery | Continuous deployment | |
|---|---|---|
| Last step | manual approval (environment reviewer, when: manual job) |
automatic |
| Needs | a reliable pipeline, a deployable main branch | all of that, plus tests and monitoring good enough to trust without a human, and fast rollback |
| Release timing | business decides (marketing launch, change window) | as soon as it's ready |
| Typical for | regulated industries, mobile apps (store review), B2B with change windows | web services, SaaS, internal platforms |
| Feature release | together with the deploy, or behind flags | decoupled with feature flags |
Neither is "more advanced" in every context. A bank may run continuous delivery with a daily approval, and that is a sound choice. What both forbid is a release that needs manual work: building on a laptop, editing config on a server, a 40-step checklist. The approval is a decision, not a chore.
Deploy is not release
Continuous deployment works because teams separate two events:
- deploy: the new code runs in production;
- release: users get the new behaviour.
Feature flags make the separation: the code ships dark, and a flag turns it on for 1 % of users, then everyone. Feature Flags shows how flag evaluation works. Deployment strategies (the next lessons) do the same at the infrastructure level: a canary releases the new version to a few percent of traffic first.
A model: what the approval step costs
Manual gates add waiting time. The model replays two weeks of merges (fixed times) through both pipelines. Delivery deploys in batches whenever the release manager approves (twice a working day); deployment ships each change after its 25-minute pipeline. It reports lead time for changes (merge to production) and the batch size of each deploy:
merges = [ # (day, hour) of each merge to main over two working weeks
(0, 9.5), (0, 11), (0, 15), (1, 10), (1, 10.5), (1, 14), (1, 16.5), (2, 9), (2, 13),
(3, 11), (3, 15.5), (4, 10), (4, 16), (7, 9.5), (7, 12), (8, 14), (9, 10), (9, 11),
(9, 15), (10, 13), (11, 9), (11, 16.5),
]
PIPELINE_H = 25 / 60
APPROVALS = [10, 15] # the release manager approves at 10:00 and 15:00 on working days
WORKDAYS = [d for d in range(15) if d % 7 < 5]
def ready(m):
return m[0] * 24 + m[1] + PIPELINE_H
def deployment():
return [ready(m) - (m[0] * 24 + m[1]) for m in merges], len(merges)
def delivery():
slots = [d * 24 + h for d in WORKDAYS for h in APPROVALS]
leads, batches = [], {}
for m in merges:
slot = next(s for s in slots if s >= ready(m))
leads.append(slot - (m[0] * 24 + m[1]))
batches[slot] = batches.get(slot, 0) + 1
return leads, batches
leads, n = deployment()
print(f"continuous deployment: {n} deploys, 1 change each, median lead time {sorted(leads)[len(leads)//2]:.1f} h")
leads, batches = delivery()
sizes = sorted(batches.values())
print(f"continuous delivery: {len(batches)} deploys, up to {sizes[-1]} changes each, "
f"median lead time {sorted(leads)[len(leads)//2]:.1f} h, worst {max(leads):.1f} h")continuous deployment: 22 deploys, 1 change each, median lead time 0.4 h
continuous delivery: 17 deploys, up to 3 changes each, median lead time 4.0 h, worst 66.0 h
The worst case is a change merged on Friday afternoon that waits for Monday's first slot. More important than the hours: each delivery deploy contains several changes, so when it breaks, someone must work out which change did it. Smaller deploys are easier to debug and roll back, the same batch-size argument as in Continuous Integration in Practice.
What to automate first
A team moving from manual releases towards continuous deployment usually goes in this order:
- one-command deploy from the pipeline (no laptops, no SSH);
- deploy to staging on every merge, automatically;
- production deploys from the pipeline with an approval (continuous delivery);
- automated post-deploy checks (smoke tests, error-rate comparison) with automatic rollback;
- drop the approval for low-risk services; keep it where the business needs it.
The approval mechanics are in Environments & Manual Approvals (GitHub) and Environments & Manual Deployments (GitLab).
Test yourself
Which step exists in continuous delivery but not in continuous deployment?
- Automated tests
- A human decision to deploy to production
- A build
- Staging
What does separating deploy from release mean?
- Deploying twice
- New code can run in production while users only get the behaviour when a flag or traffic split turns it on
- Releasing without deploying
- Using two clusters
Besides longer lead times, what does the batching in the model cost?
- Nothing
- Each deploy contains several changes, so failures are harder to attribute and roll back
- More pipeline minutes
- Slower tests