Skip to content

Beginner · DevOps culture and the SDLC · topic 3 of 53 · 35 min

Core DevOps practices and the DORA metrics

Explanation

DevOps rests on a few core practices: keep everything in version control, integrate and test continuously, deliver in small batches, define infrastructure as code, and monitor what runs. The DORA research programme measures how well a team delivers with four key metrics: deployment frequency, lead time for changes, change failure rate and time to restore service.

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.

PracticeWhat it meansWhy it helps
Version control everythingCode, tests, pipeline files, server settings and infrastructure all live in GitEvery 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 automaticallyProblems are found within minutes, while the change is fresh
Continuous deliveryEvery change that passes the pipeline is ready to release; going to production is one button pressReleasing becomes boring and low-risk
Continuous deploymentEvery change that passes the pipeline goes to production automatically, with no buttonFastest feedback from real users
Infrastructure as code (IaC)Servers, networks and databases are described in files (for example Terraform) and created by toolsEnvironments are identical and can be rebuilt
Configuration managementSoftware and settings on servers are applied by tools such as AnsibleNo hand-edited, unique "snowflake" servers
Monitoring and observabilityMetrics, logs and traces show how the system behaves in productionYou 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.

python
if flags.is_enabled("new_checkout", user_id):
    show_new_checkout()
else:
    show_old_checkout()
A feature flag check. The new checkout is deployed but only shown to users for whom the flag is on.

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.

MetricQuestionHow to compute it
Deployment frequencyHow often do we deploy to production?Number of deployments divided by the period, for example per week
Lead time for changesHow long from commit to running in production?Deploy time minus commit time; teams usually report the median
Change failure rateWhat share of deployments cause a failure in production?Failed deployments divided by all deployments, as a percentage
Time to restore serviceWhen 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.

Careful: Common mistakes: (1) Using DORA numbers to rank individual developers. They describe a team’s system of work, and people quickly game metrics used against them. (2) Counting deployments to a test server as deployment frequency; count production only. (3) Measuring lead time from the start of a ticket instead of from the commit. (4) Chasing one number: deploying ten times a day with a 50% failure rate is not success.
Tip: You do not need an expensive tool to start. A spreadsheet with deploy time, commit time, success or failure, and minutes to restore gives you all four metrics within a month.

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

Practices and DORA

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)

Task 1 · Question

Every change that passes the pipeline is deployed to production automatically, with no human approval. What is this called?

Task 2 · Code · Python

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.

Task 3 · Question

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

Question 1

1.Which of these is NOT one of the four key DORA metrics?

Question 2

2.Out of 20 production deployments, 3 caused an incident. What is the change failure rate?

Question 3

3.What does "shift left" mean?

Question 4

4.In trunk-based development, how long do branches usually live?

Question 5

5.What did DORA research find about speed and stability?

Read more (free)

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.

From Continuous integration, delivery and deployment

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.

From What DevOps is and the problem it solves

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.

From CI/CD: shipping every change safely

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.

From DevSecOps: shifting security left

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. 1 more topic in “DevOps culture and the SDLC” before its exam: The DevOps toolchain and your learning roadmap.
  2. Module 1 exam: DevOps culture and the SDLC · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Linux for DevOps. 53 topics left in the course before the final exam.

← Previous: The SDLC: waterfall, agile, Scrum and Kanban