Lesson 2 of 2 · Cloud & DevOps Overview

Introduction to DevOps

Why DevOps exists, from waterfall and agile to the wall between Dev and Ops, the DevOps lifecycle, CI/CD, popular tools, how DevOps is measured, and what it means for databases.

Beginner 11 sections 11 min read

Why DevOps matters

DevOps is a combination of culture, practices, and tools that helps a company deliver software faster and more reliably, by bringing software development (Dev) and IT operations (Ops) together as one team.

Today, almost every business is a software business. Banks, retailers, and airlines compete on their apps and websites, so the speed and quality of their software directly affects their customers and revenue. DevOps uses collaboration and automation to:

  • Release new features and fixes faster.
  • Improve the quality and reliability of each release.
  • Join up the work of the people who build software and the people who run it.

How software was built before DevOps

The software development life cycle (SDLC) is the series of steps a team follows to build and release software. Two approaches came before DevOps.

Waterfall

In waterfall, each phase is finished completely before the next one begins, like water flowing down a series of steps:

1 Requirements 2 Design 3 Development 4 Testing 5 Deployment 6 Maintenance Each phase finishesbefore the next begins Bugs are found here,often months after thecode was written
  • Works well when the requirements are clear and won't change, such as a system built to a fixed contract.
  • The downside: it's slow, and defects aren't discovered until testing, late in the cycle, when they're most expensive to fix.

Agile

Agile breaks the work into short cycles called sprints, usually one to four weeks long. Each sprint delivers a small, working piece of software, and the plan is adjusted as the team learns. Scrum and Kanban are popular ways of working in an agile way.

Sprint 1Sprint 2Sprint 3Sprint 4 2 weeks2 weeks2 weeks2 weeks Development delivers working software every sprint THE HAND-OFF Operations deploys and runs it, often weeks later
  • Works well when requirements change often and the business needs software quickly.
  • The downside: agile sped up development, but not operations. Finished software still had to be handed over to a separate Ops team to deploy and run, and the speed gained in development was often lost at that hand-off.

Dev vs Ops: change vs stability

The two teams had goals that pulled in opposite directions:

  • Development is rewarded for change: new features, new technology, and bug fixes, released as fast as possible.
  • Operations is rewarded for stability: keeping systems secure and "up to PAR" for performance, availability, and recoverability. To Ops, every change is a risk of an outage.
</> Development wants change: newfeatures and fixes,released fast Operations wants stability:performance, availability,recoverability "Thrown over the wall": Dev hands off code, Ops deals with the problems DevOps: one team, shared goals, automated hand-offs

When something broke in production, each side blamed the other. Common symptoms of this split include:

  • Defects aren't found until late in the cycle, or worse, in production.
  • Speed gained in development disappears once the software reaches production.
  • Developers and testers wait days or weeks for servers, databases, and environments.
  • Development, test, and production are set up differently, so something that works in testing fails in production.
  • Manual steps lead to simple human errors during deployments.
  • Developers see their job as done once the code is handed over.
  • When problems happen, people look for someone to blame instead of a fix.

What's DevOps

DevOps grew out of agile in the late 2000s. It extends agile's short cycles and close collaboration beyond development, all the way through testing, release, and operations. Dev and Ops work as one team, sharing responsibility for the software from the first line of code until it's running smoothly for customers.

A common way to summarize DevOps is CALMS:

Culture
Shared ownership and trust between Dev and Ops. When something fails, the team fixes the process, not the blame.
Automation
Builds, tests, deployments, and infrastructure are automated, so they're fast and repeatable.
Lean
Work moves in small batches, and waiting and waste are removed.
Measurement
Teams measure how their delivery and systems perform, and improve based on data.
Sharing
Knowledge, tools, and lessons learned are shared across teams.

The DevOps lifecycle

DevOps is usually drawn as an infinity loop. Work flows through eight stages, then feedback from running the software flows straight back into planning, and the loop starts again:

DEV build it OPS run it 1 Plan 2 Code 3 Build 4 Test 5 Release 6 Deploy 7 Operate 8 Monitor
StageWhat happens
PlanDecide what to build next, based on business needs and feedback.
CodeWrite the code and keep every change in version control.
BuildAutomatically turn the code into something that can run.
TestAutomatically check that it works and that nothing else broke.
ReleaseApprove a tested version as ready for production.
DeployInstall it in production, automatically and the same way every time.
OperateRun and maintain it, including scaling, patching, and backups.
MonitorWatch performance, errors, and user behavior, and feed what you learn back into planning.

The "continuous" practices: CI/CD

DevOps is built on a set of practices that all start with "continuous". They're what make small, frequent, safe releases possible:

Commit Build Test Release Production CONTINUOUS INTEGRATION every change is built and tested CONTINUOUS DELIVERY always ready to release; a person approves production CONTINUOUS DEPLOYMENT every change that passes goes to production automatically
Continuous integration (CI)
Developers merge their changes into a shared main branch often, at least daily. Every merge automatically triggers a build and a set of tests, so problems are caught within minutes, while they're still small.
Continuous delivery (CD)
Every change that passes the tests is automatically prepared for release, so the software is always ready to deploy. Going to production is a business decision, made with a button press.
Continuous deployment
One step further: every change that passes all the automated tests goes to production automatically, with no manual approval.
Continuous testing
Automated tests run at every stage of the pipeline, from small checks on each piece of code to full tests of the whole system.
Continuous monitoring
Production systems are watched all the time, collecting data on performance, errors, and usage. It provides a baseline for normal behavior, alerts when something changes, and feedback for the next round of planning.

The automated sequence that takes a change from commit to production is called a CI/CD pipeline.

Popular DevOps tools

Every stage of the DevOps lifecycle has its own tools, and a CI/CD server ties them together, running each stage automatically whenever code changes. Here are some of the most widely used tools for each stage:

DEV 1 Plan2 Code3 Build4 Test track the workversion controlpackage the codeautomated checks JiraAzure BoardsConfluence GitGitHubGitLab, Bitbucket MavenGradle, npmDocker JUnit, pytestSeleniumSonarQube CI/CD SERVER Jenkins · GitHub Actions · GitLab CI/CD · Azure Pipelines OPS 5 Release6 Deploy7 Operate8 Monitor store versioned buildsroll out changesrun the infrastructuremetrics, logs, alerts ArtifactoryNexusAmazon ECR Argo CDHelmOctopus Deploy KubernetesTerraformAnsible PrometheusGrafanaDatadog, Splunk
The CI/CD server runs the pipeline, calling the right tool at each stage.
StageWhat the tools doPopular toolsFor databases
1. PlanTrack work, bugs, and sprints, and document decisionsJira, Azure Boards, Confluence, TrelloThe same tools: database changes are tracked like any other work
2. CodeVersion control: keep every change, who made it, and whyGit, hosted on GitHub, GitLab, or BitbucketSQL scripts and migration files live in Git, next to the application code
3. BuildCompile and package the code into something that can runMaven, Gradle, npm, DockerLiquibase or Flyway check and package the database changes
4. TestRun automated tests and check code qualityJUnit, pytest, Selenium, SonarQubeutPLSQL (Oracle) and tSQLt (SQL Server) test database code
5. ReleaseStore each tested build as a versioned, ready-to-deploy packageJFrog Artifactory, Sonatype Nexus, container registries such as Docker Hub and Amazon ECRVersioned migration scripts are released with the application version they belong to
6. DeployRoll the release out to each environment, the same way every timeArgo CD, Helm, Octopus Deploy, AWS CodeDeployLiquibase or Flyway apply the changes to each database in order
7. OperateCreate and configure infrastructure from code, and run applicationsTerraform, Ansible, Docker, KubernetesTerraform creates database servers and cloud databases; Ansible configures them
8. MonitorCollect metrics and logs, show dashboards, and send alertsPrometheus, Grafana, Datadog, Splunk, Elastic (ELK) StackOracle Enterprise Manager, plus database monitoring in Datadog and Grafana
All stages: CI/CDRun the pipeline automatically on every changeJenkins, GitHub Actions, GitLab CI/CD, Azure Pipelines, CircleCIThe same pipeline runs database changes alongside application changes

Where to start

You don't need to learn every tool. A handful show up in almost every DevOps job, and each one is a good first step:

Git
Version control. Everything in DevOps starts with code in Git, so learn this first.
Jenkins or GitHub Actions
CI/CD servers that run your pipeline. Jenkins is the long-standing open source choice; GitHub Actions is built into GitHub.
Docker
Packages an application and everything it needs into a container that runs the same way on any machine.
Kubernetes
Runs and manages many containers across many servers, restarting and scaling them automatically.
Terraform
Infrastructure as code: describe servers, networks, and databases in files, and Terraform creates them for you.
Ansible
Configures servers automatically, such as installing software or applying settings, from simple scripts called playbooks.
Prometheus and Grafana
Prometheus collects metrics from systems; Grafana turns them into dashboards and alerts.
Liquibase or Flyway
Version and deploy database schema changes, the database side of the pipeline.

Measuring DevOps

How do you know DevOps is working? The most widely used research, from the DevOps Research and Assessment (DORA) program, measures software delivery with four key metrics:

SPEEDSPEEDSTABILITYSTABILITY Deploymentfrequency Lead timefor changes Changefailure rate Time torestore how often you releaseto production from committo production how many releasescause problems how quickly yourecover from failure

DORA's research has found, year after year, that speed and stability go together: the best-performing teams release more often and have fewer failures, because small, frequent, automated changes are easier to test and easier to fix.

What DevOps means for databases

For years, the database was the slowest part of the pipeline: application code was deployed automatically, but database changes waited for a DBA to run scripts by hand. DevOps brings the same practices to the database, sometimes called database DevOps:

  • Database changes as code. Every schema change is a versioned script stored in Git, alongside the application code.
  • Automated migrations. Tools such as Liquibase and Flyway apply those scripts in the right order, in every environment.
  • Testing database changes. The pipeline tests each change on a copy of the database before it reaches production.
  • Infrastructure as code. Tools such as Terraform create databases and their settings from code, so every environment is built the same way.
  • Monitoring database health and performance continuously, with alerts.

DBAs who can work this way are in high demand. The Database DevOps Engineer path covers Agile, Git, Terraform, Ansible, database CI/CD, and monitoring in depth.

In practice: one new column, two ways

A developer needs a new phone_number column on the customers table.

  • Before DevOps: the developer emails a script to the DBA team and opens a ticket. A week later, Kofi runs it by hand during Saturday's change window. It worked in test, but fails in production, because production was changed by hand months ago and no longer matches.
  • With DevOps: the change is a versioned script in Git, next to the application code. The pipeline applies it to a test database automatically, Kofi reviews it in a pull request, and after approval, the same pipeline applies it to production, exactly as tested.

The DBA still reviews and protects production; the waiting, the manual steps, and the surprises are gone.

Key takeaways

  • DevOps is a way of working that brings development and operations together to release software faster and more reliably. It isn't a product.
  • Waterfall found defects late; agile sped up development, but releases still stalled at the hand-off to operations.
  • Dev wants change and Ops wants stability. DevOps replaces the wall between them with one team and shared goals.
  • The DevOps lifecycle loops through plan, code, build, test, release, deploy, operate, and monitor.
  • Continuous integration, delivery, and deployment automate the path from a code change to production.
  • DORA's four metrics measure delivery speed and stability, and the best teams excel at both.
  • Database DevOps treats schema changes as versioned, tested, automated code.