Beginner · DevOps culture and the SDLC · topic 3 of 53 · 35 min
Core DevOps practices and the DORA metrics
Explanation
The practices that make DevOps real
Culture is the foundation, but a team also needs concrete habits. These practices appear in almost every DevOps team. You will learn each of them in depth later in this course.
| Practice | What it means | Why it helps |
|---|---|---|
| Version control everything | Code, tests, pipeline files, server settings and infrastructure all live in Git | Every change is tracked, reviewed and reversible |
| Continuous integration (CI) | Every developer merges small changes into the main branch often, and each merge is built and tested automatically | Problems are found within minutes, while the change is fresh |
| Continuous delivery | Every change that passes the pipeline is ready to release; going to production is one button press | Releasing becomes boring and low-risk |
| Continuous deployment | Every change that passes the pipeline goes to production automatically, with no button | Fastest feedback from real users |
| Infrastructure as code (IaC) | Servers, networks and databases are described in files (for example Terraform) and created by tools | Environments are identical and can be rebuilt |
| Configuration management | Software and settings on servers are applied by tools such as Ansible | No hand-edited, unique "snowflake" servers |
| Monitoring and observability | Metrics, logs and traces show how the system behaves in production | You see problems before users report them |
Continuous delivery versus continuous deployment
The two terms share the short form CD, which confuses many people. In continuous delivery, the software is always in a releasable state, but a person decides when to push it to production. In continuous deployment, there is no human step: if all automated checks pass, the change goes live. Banks and regulated companies often choose continuous delivery with an approval step. Many web companies use continuous deployment.
Shift left
Picture the SDLC drawn from left (plan) to right (operate). "Shift left" means moving testing and security checks earlier, to the left. Instead of a security review one week before launch, the pipeline scans every commit for known vulnerable libraries and leaked passwords. A bug found while coding costs minutes; the same bug found in production can cost days and customer trust.
Small batches and trunk-based development
A batch is the amount of change released together. Small batches mean less risk and faster feedback. Trunk-based development supports this: everyone works on short-lived branches (hours or a day or two) and merges into the main branch, called trunk, many times a week. Long-lived feature branches that stay apart for a month end in painful merge conflicts.
Feature flags: separate deploy from release
A feature flag (or feature toggle) is a switch in the code that turns a feature on or off without a new deployment. Teams deploy unfinished code with the flag off, so trunk stays releasable. Later they switch it on for 1% of users, then 10%, then everyone. If something goes wrong, they switch it off in seconds.
if flags.is_enabled("new_checkout", user_id):
show_new_checkout()
else:
show_old_checkout()Measuring delivery: the DORA metrics
DORA (DevOps Research and Assessment) is a long-running research programme, now part of Google Cloud, that publishes the yearly State of DevOps report. Its research found four key metrics that separate high-performing teams from low performers. Two measure speed and two measure stability.
| Metric | Question | How to compute it |
|---|---|---|
| Deployment frequency | How often do we deploy to production? | Number of deployments divided by the period, for example per week |
| Lead time for changes | How long from commit to running in production? | Deploy time minus commit time; teams usually report the median |
| Change failure rate | What share of deployments cause a failure in production? | Failed deployments divided by all deployments, as a percentage |
| Time to restore service | When a deployment fails, how fast do we recover? | Average (or median) time from failure to recovery |
The key finding is that speed and stability go together. The best teams deploy more often AND fail less AND recover faster, because small batches and automation help both.
DORA keeps refining its model. Later reports added a fifth measure about operational reliability, renamed "time to restore service" to "failed deployment recovery time", and added further measures. The four keys above are still the standard starting point; check the current DORA report on dora.dev for the latest names and benchmark ranges.
A worked example
Over 10 days a team made 5 deployments. Deployment frequency is 5 / 10 x 7 = 3.5 per week. Lead times were 4, 24, 2, 30 and 6 hours; sorted they are 2, 4, 6, 24, 30, so the median is 6 hours. Two deployments failed, so change failure rate is 2 / 5 = 40%. They took 45 and 15 minutes to restore, so the mean time to restore is 30 minutes. The 40% failure rate is the clear problem to work on.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Core DevOps practices and the DORA metrics · 1/8
Culture needs habits. Here are the core DevOps practices and the four numbers that measure them.
Prefer a video by a teacher? Find free videos on “dora four key metrics explained deployment frequency lead time” on YouTube ↗
In real life: A payments team tracks DORA metrics
A payments team at a Mumbai fintech exported its deployment history from the pipeline: commit time, deploy time, whether the deploy caused an incident, and minutes to recover. In the first month they deployed twice a week with a 30% change failure rate. Most failures came from database changes tested only by hand. They added automated migration tests to CI and moved new features behind flags. Three months later they deployed daily, and the failure rate fell to about 10%.
Practice (0/3 done)
Every change that passes the pipeline is deployed to production automatically, with no human approval. What is this called?
Each deployment record is a dict like {"committed": "2026-10-01 09:00", "deployed": "2026-10-01 13:00", "failed": False, "restore_minutes": 0}. Write dora_metrics(records, days) that returns a dict with four keys, each rounded to 1 decimal place: "deploys_per_week" (number of records / days x 7), "median_lead_hours" (median of deployed minus committed, in hours), "change_failure_rate" (failed records / all records x 100) and "mean_restore_minutes" (average restore_minutes of the FAILED records, or 0.0 if none failed). Use datetime.fromisoformat and statistics.median.
A team ships unfinished code to production every day but keeps the new screen hidden until it is ready, then switches it on for 5% of users. Which practice is this?
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- The DevOps toolchain and your learning roadmapDevOps culture and the SDLC · same module
- Continuous integration, delivery and deploymentCI/CD pipelines
- CI/CD: shipping every change safelyFull-Stack Development · Deploying and running the app
- DevSecOps: shifting security leftDevSecOps
- Deployment strategies, feature flags and GitOpsCI/CD pipelines
- Go in cloud and DevOps: Kubernetes, Terraform and PrometheusGo Programming (backend and cloud) · CLI tools and Go in cloud and DevOps
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Which of these is NOT one of the four key DORA metrics?
Answer: Lines of code written per day
Lines of code says nothing about delivery. The four keys are deployment frequency, lead time, change failure rate and time to restore.
Out of 20 production deployments, 3 caused an incident. What is the change failure rate?
Answer: 15%
3 / 20 = 0.15, which is 15%.
What does "shift left" mean?
Answer: Move testing and security checks earlier in the life cycle
On a left-to-right SDLC diagram, earlier stages are on the left. Shift left means checking earlier.
In trunk-based development, how long do branches usually live?
Answer: Hours, or a day or two
Short-lived branches merged often keep everyone close to trunk and avoid painful merges.
What did DORA research find about speed and stability?
Answer: The best teams achieve both high speed and high stability
High performers deploy more often and also fail less and recover faster.
What is the main idea of continuous integration?Related
Answer: Merge small changes often, and build and test every push automatically
Frequent small merges with automated checks catch problems while they are small.
Which stage comes right after "deploy" in the DevOps infinity loop?Related
Answer: Operate
The order is plan, code, build, test, release, deploy, operate, monitor.
What is a preview deployment?Related
Answer: A temporary copy of the app built from a pull request, with its own URL
Previews let reviewers try a change for real before it is merged. They should use preview data, not production.
What does "shift left" mean in DevSecOps?Related
Answer: Doing security checks earlier in the delivery process
Left is the start of the delivery line (design and code). Finding problems there is cheaper.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 1 more topic in “DevOps culture and the SDLC” before its exam: The DevOps toolchain and your learning roadmap.
- Module 1 exam: DevOps culture and the SDLC · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Linux for DevOps. 53 topics left in the course before the final exam.