Aller au contenu
Londres, Royaume-Uni · Fondé en 1994
Français

Unit 5: DevOps, Delivery and Software Maintenance

How teams deliver software quickly and safely through automation, keep it running reliably in operation, and maintain and evolve it over many years.

Unit 5 of 5 · about 54 minutes

5.1 DevOps and continuous delivery

In many organisations, developers who wrote software and operations staff who ran it once worked in separate teams with different goals. Developers wanted to release changes quickly; operations staff wanted stability and were wary of change. Releases were large, infrequent and stressful. DevOps is a set of cultural and technical practices that bring development and operations together, so that teams can deliver changes frequently, reliably and safely.

DevOps principles

  • Shared responsibility: the team that builds a service also cares about how it runs in production, often summarised as "you build it, you run it".
  • Automation: repetitive tasks such as building, testing and deploying software are automated, reducing errors and freeing people for higher-value work.
  • Small, frequent changes: releasing small changes often is less risky than releasing large changes rarely, because each change is easier to understand, test and, if necessary, undo.
  • Fast feedback: teams learn quickly whether changes work, from automated tests and from monitoring in production.
  • Continuous improvement: teams regularly reflect on and improve their processes, using data where possible.

Continuous integration

Continuous integration (CI) is the practice of merging developers' changes into a shared main branch frequently, at least daily, with each change automatically built and tested. If the build or tests fail, the team is alerted immediately and fixing the problem becomes a priority. CI prevents the painful "integration phase" that occurs when separate changes are combined only at the end, and it keeps the main branch in a working state.

Continuous delivery and deployment

Continuous delivery extends CI so that every change that passes the automated checks is ready to be released to users at any time, with release itself requiring only a simple decision. Continuous deployment goes one step further: every change that passes all checks is released to production automatically, without manual approval.

Both rely on a deployment pipeline: an automated sequence of stages that each change passes through. A typical pipeline might:

  1. build the software from the latest code;
  2. run unit tests and static analysis;
  3. scan dependencies for known vulnerabilities;
  4. deploy to a test environment and run integration and acceptance tests;
  5. run performance or security checks where appropriate;
  6. deploy to production, often gradually.

Safer releases

Several techniques reduce the risk of each release:

  • Feature flags allow new functionality to be deployed but switched off, then turned on for selected users when ready. This separates deploying code from releasing features.
  • Canary releases send a new version to a small proportion of users first, expanding only if monitoring shows no problems.
  • Blue-green deployment runs the old and new versions side by side, switching traffic to the new version and switching back quickly if needed.
  • Automated rollback returns to the previous version if key measures deteriorate after a release.

Infrastructure as code

Traditionally, servers and networks were configured by hand, leading to inconsistencies and undocumented changes. Infrastructure as code defines infrastructure in configuration files that are stored in version control, reviewed and applied automatically. Environments can then be created consistently and repeatedly, and every change is recorded. Containers package an application with everything it needs to run, so it behaves the same way on a developer's laptop, in testing and in production.

Tip: if a release process is painful, do it more often, not less. Frequent releases force teams to automate and simplify, and make each individual release smaller and safer.

Measuring delivery performance

Research programmes studying software delivery have popularised four key measures, often called the DORA metrics after the research group that developed them:

  • deployment frequency: how often changes are released;
  • lead time for changes: how long it takes for a change to go from commit to production;
  • change failure rate: the proportion of releases that cause a failure in production;
  • time to restore service: how quickly service is recovered after a failure.

An important finding from this work is that speed and stability need not conflict. Teams with good practices tend to achieve both.

Common mistakes

  • Treating DevOps as a job title or a set of tools rather than a way of working.
  • Automating a poor process without first simplifying it.
  • Leaving a broken build unfixed while continuing to add changes.
  • Making manual changes to production systems that are not recorded anywhere.

In practice

Ask a development team you work with how a code change reaches users. How many manual steps are involved, and how long does it typically take? How often do releases happen, and what happens if one goes wrong? Mapping this journey, even roughly, usually reveals delays and risks that automation and smaller changes could reduce.

5.2 Running software reliably

Releasing software is only the beginning. Once it is live, users depend on it being available, fast and correct. Running software reliably requires the ability to see what is happening inside systems, to set sensible reliability goals and to respond effectively when things go wrong. Many of these practices are associated with site reliability engineering (SRE), an approach that applies software engineering methods to operations.

Monitoring and observability

Monitoring means collecting and watching measurements that show whether a system is healthy. Observability is the broader property of a system that allows engineers to understand its internal state from its outputs, including problems nobody anticipated. It typically relies on three kinds of data:

  • Logs: time-stamped records of events, such as errors or completed transactions.
  • Metrics: numerical measurements over time, such as requests per second, error rates, response times and resource usage.
  • Traces: records of how a single request travels through the different components of a system, which is particularly useful in distributed systems.

A useful starting point for monitoring any service is to track four signals: latency (how long requests take), traffic (how much demand there is), errors (how many requests fail) and saturation (how close the system is to its capacity).

Alerting

Alerts notify people when something needs attention. Good alerts are based on symptoms that affect users, such as a rise in failed payments, rather than every internal fluctuation. Each alert should be actionable, with guidance on what to do. Too many alerts lead to alert fatigue, in which important warnings are missed among the noise.

Service levels

Perfect reliability is neither achievable nor usually worth the cost. Teams therefore set explicit targets:

  • A service level indicator (SLI) is a measure of some aspect of service, such as the proportion of requests that succeed or are answered within 300 milliseconds.
  • A service level objective (SLO) is a target for that indicator, such as 99.9 per cent of requests succeeding over 30 days.
  • A service level agreement (SLA) is a formal commitment to customers, often with financial consequences if it is missed. SLAs are usually set less strictly than internal SLOs.

The gap between perfection and the SLO is called the error budget. An SLO of 99.9 per cent allows 0.1 per cent of requests to fail. While the error budget remains, teams can release new features freely; if it is used up, they focus on reliability. This creates a shared, objective basis for balancing speed and stability.

Remember: reliability targets should reflect what users actually need. A slightly higher target can require a dramatically larger investment, so choose levels deliberately rather than aiming for perfection.

Incident management

When a service fails, a structured response limits the impact. Typical practices include:

  1. Detect the problem quickly through monitoring or user reports.
  2. Declare an incident and assign an incident lead to coordinate the response.
  3. Mitigate first: restore service as quickly as possible, for example by rolling back a release, even before the root cause is fully understood.
  4. Communicate regularly with affected users and stakeholders.
  5. Resolve the underlying cause once service is restored.
  6. Review what happened and how to prevent recurrence.

Many teams operate an on-call rota so that someone is available to respond outside normal hours. On-call arrangements should be sustainable, fairly shared and supported by clear guides, often called runbooks.

Blameless post-incident reviews

After significant incidents, teams hold a post-incident review (often called a postmortem). The review describes what happened, its impact, how it was detected and resolved, and what contributed to it. Effective reviews are blameless: they assume people acted reasonably given the information they had, and focus on improving systems and processes rather than finding someone to blame. Blame discourages honesty and hides the conditions that allowed the incident to happen.

Resilience

Reliable systems are designed to cope with failure. Techniques include running multiple copies of components, retrying failed requests sensibly, setting time limits on calls to other services and degrading gracefully, for example still allowing customers to browse when recommendations are unavailable. Backups and disaster recovery plans should be tested regularly.

In practice

For a service you rely on, write down what "working well" means to its users: perhaps pages load quickly and orders are confirmed reliably. Turn one of these into a possible SLI and SLO. Then ask the team responsible how they would know if it were failing, and what happens next. These conversations help align technical work with what users actually value.

5.3 Maintenance, technical debt and evolving systems

Software that is used is never finished. Users request improvements, regulations change, security vulnerabilities are discovered, supporting technologies are updated and business needs evolve. Software maintenance covers all the work done after software is first released, and for long-lived systems it typically accounts for most of the total effort. Managing it well is central to software engineering.

Types of maintenance

TypePurposeExample
CorrectiveFixing defects discovered in use.Correcting a calculation error in invoices.
AdaptiveKeeping software working in a changing environment.Updating the system for a new operating system or a change in tax rules.
PerfectiveImproving functionality, performance or usability.Adding a new report requested by users, or speeding up a slow page.
PreventiveReducing the likelihood of future problems.Restructuring complex code or updating outdated libraries before they cause trouble.

Corrective work often receives most attention, but adaptive and preventive maintenance are essential to keeping systems healthy over time.

Technical debt

Technical debt is a metaphor for the future cost created when teams choose a quicker or easier solution now instead of a better one. Like financial debt, it can be useful: taking a shortcut to meet an important deadline may be a sensible business decision. But debt accrues "interest": each future change takes longer and is riskier because of the shortcut. If debt is never repaid, it can grow until even small changes become slow and dangerous.

Technical debt comes in several forms, including duplicated or overly complex code, missing tests, outdated dependencies, poor documentation and architectural decisions that no longer fit. Some debt is taken on deliberately; some arises inadvertently as understanding improves; and some accumulates simply because the world changes around the software.

Managing technical debt

  • Make it visible: record significant debt in the backlog, describing its impact in terms stakeholders understand, such as slower delivery or higher risk of failure.
  • Prioritise: focus on debt in areas that change often or are critical, where the interest is highest.
  • Allocate capacity: many teams reserve a regular share of their time for improvement work.
  • Follow the "boy scout rule": leave code a little better than you found it whenever you work on it.

Refactoring

Refactoring means improving the internal structure of code without changing its external behaviour. Examples include renaming unclear variables, breaking long functions into smaller ones and removing duplication. Refactoring is safest in small steps supported by good automated tests, which confirm that behaviour has not changed. It should be part of everyday work rather than a rare, large project.

Tip: when explaining technical debt to non-technical colleagues, describe its effect on outcomes they care about: "this area takes three times longer to change than it should, and most of our recent defects came from it" is more persuasive than "the code is messy".

Legacy systems

A legacy system is an older system that remains important but is difficult to maintain, perhaps because it uses outdated technology, lacks documentation or tests, or depends on knowledge held by a few people. Legacy systems often run critical operations, so replacing them carries significant risk.

A complete "big bang" rewrite is tempting but frequently fails: rewrites take longer than expected, the old system's undocumented behaviours are missed, and the business must wait years for any benefit. A widely recommended alternative is the strangler fig pattern, named after a plant that gradually grows around a tree. New functionality is built alongside the old system, and parts of the old system are replaced one at a time, with traffic redirected gradually, until the old system can be retired. This delivers value earlier and reduces risk.

Keeping systems healthy

  • Keep dependencies and platforms reasonably up to date, rather than allowing them to fall years behind.
  • Maintain good automated tests, which make change safer.
  • Document key decisions and system knowledge so that it does not rest with a few individuals.
  • Plan for the retirement of systems, including how data will be migrated or archived.

Common mistakes

  • Treating maintenance as less important or less skilled work than building new features.
  • Ignoring technical debt until delivery slows dramatically.
  • Attempting a full rewrite of a large system in one step.
  • Refactoring without tests, introducing new defects.

In practice

Think of a system you work with that seems slow to change or prone to problems. List possible sources of technical debt and their effects on users or the business. Suggest one small improvement that could be made alongside normal work, and one larger item that should be planned. Presenting debt in terms of business impact, with practical steps, is one of the most effective ways to secure time to address it.

Case study: Modernising a booking platform at a travel firm

Coastline Holidays, a fictional travel company, relied on a booking system built fifteen years earlier. Releases happened twice a year, took a whole weekend and often caused problems. Only two developers understood the pricing code, and there were few automated tests.

Leadership initially proposed a complete rewrite. The head of engineering instead recommended a gradual approach. The team first introduced version control for all code and configuration, built an automated pipeline and wrote tests around the most critical booking flows. They agreed service level objectives for search and booking, and added monitoring of latency and errors.

Using the strangler fig pattern, they built a new search service alongside the old system and routed a small share of traffic to it, increasing it as confidence grew. Pricing logic was refactored in small steps, guided by the new tests, and documented as it went.

Over eighteen months, releases moved from twice a year to several times a week, and the time needed to recover from failures fell considerably. Parts of the old system were still in use, but each was now on a clear path to retirement.

Activity

Choose a software system you know and describe how a change currently reaches users, from idea to release. Identify two improvements from this unit that would make delivery faster or safer and explain how they would help. Then list three items of technical debt or maintenance work and classify each as corrective, adaptive, perfective or preventive.

Compare with a model answer

A good answer describes the current process honestly, for example: changes are developed on long-lived branches, tested manually over a week and released monthly by an operations engineer following a written checklist. It proposes relevant improvements, such as an automated pipeline running unit and integration tests on every change, and feature flags or canary releases to reduce release risk. It explains the benefits clearly, such as faster feedback and the ability to roll back quickly.

The maintenance list is realistic and correctly classified: fixing a recurring error in the export function (corrective), updating the system for a new version of a payment provider's interface (adaptive) and adding automated tests to the pricing module before it is next changed (preventive).

Key takeaways

  • DevOps brings development and operations together through shared responsibility, automation, small frequent changes and fast feedback.
  • Continuous integration and delivery use an automated pipeline so that every change is built, tested and ready to release safely.
  • Observability, symptom-based alerting and service level objectives with error budgets help balance reliability and speed.
  • Incidents should be handled by mitigating first and learning afterwards through blameless post-incident reviews.
  • Maintenance accounts for most lifetime effort; technical debt should be made visible and repaid, and legacy systems replaced gradually rather than in one rewrite.

Unit check

Create a free account to answer the check, save your progress and receive your free certificate.

Create a free account Log in
← Unit 4
WhatsApp