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.
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:
- 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.
- 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.
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:
| Stage | What happens |
|---|---|
| Plan | Decide what to build next, based on business needs and feedback. |
| Code | Write the code and keep every change in version control. |
| Build | Automatically turn the code into something that can run. |
| Test | Automatically check that it works and that nothing else broke. |
| Release | Approve a tested version as ready for production. |
| Deploy | Install it in production, automatically and the same way every time. |
| Operate | Run and maintain it, including scaling, patching, and backups. |
| Monitor | Watch 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:
- 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:
| Stage | What the tools do | Popular tools | For databases |
|---|---|---|---|
| 1. Plan | Track work, bugs, and sprints, and document decisions | Jira, Azure Boards, Confluence, Trello | The same tools: database changes are tracked like any other work |
| 2. Code | Version control: keep every change, who made it, and why | Git, hosted on GitHub, GitLab, or Bitbucket | SQL scripts and migration files live in Git, next to the application code |
| 3. Build | Compile and package the code into something that can run | Maven, Gradle, npm, Docker | Liquibase or Flyway check and package the database changes |
| 4. Test | Run automated tests and check code quality | JUnit, pytest, Selenium, SonarQube | utPLSQL (Oracle) and tSQLt (SQL Server) test database code |
| 5. Release | Store each tested build as a versioned, ready-to-deploy package | JFrog Artifactory, Sonatype Nexus, container registries such as Docker Hub and Amazon ECR | Versioned migration scripts are released with the application version they belong to |
| 6. Deploy | Roll the release out to each environment, the same way every time | Argo CD, Helm, Octopus Deploy, AWS CodeDeploy | Liquibase or Flyway apply the changes to each database in order |
| 7. Operate | Create and configure infrastructure from code, and run applications | Terraform, Ansible, Docker, Kubernetes | Terraform creates database servers and cloud databases; Ansible configures them |
| 8. Monitor | Collect metrics and logs, show dashboards, and send alerts | Prometheus, Grafana, Datadog, Splunk, Elastic (ELK) Stack | Oracle Enterprise Manager, plus database monitoring in Datadog and Grafana |
| All stages: CI/CD | Run the pipeline automatically on every change | Jenkins, GitHub Actions, GitLab CI/CD, Azure Pipelines, CircleCI | The 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:
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.