CI/CD Basics for Backend Developers
Automating the path from a commit to a running service, and why manual deploys don't scale with a team.
2 min read
Every code change eventually needs to become a running service in production. CI/CD automates that path — continuous integration validates each change automatically, continuous delivery/deployment gets a validated change into production — replacing manual, error-prone steps with a repeatable pipeline.
Continuous Integration (CI)
CI runs automatically on every push or pull request, validating that a change doesn't break anything before it merges:
# Simplified CI pipeline
on: [pull_request]
jobs:
test:
steps:
- checkout code
- install dependencies
- run linter
- run unit tests
- run integration tests (often against a containerized test database)The point is catching problems immediately, on the change that introduced them, rather than discovering a broken build days later after several more commits have landed on top of it — at which point figuring out which change actually broke things is much harder.
Continuous Delivery vs. Continuous Deployment
These two terms get used loosely, but they describe a real distinction:
- Continuous Delivery — every change that passes CI is automatically packaged and ready to deploy, but a human still triggers the actual production deploy.
- Continuous Deployment — every change that passes CI deploys to production automatically, with no manual step at all.
Continuous deployment demands a strong automated test suite and good monitoring, since there's no human reviewing each release before it reaches users — the safety net has to be entirely automated.
A typical backend pipeline
Push code
→ CI: lint, test, build container image
→ Push image to a registry
→ CD: deploy image to staging
→ Run smoke tests against staging
→ (Continuous Delivery: wait for approval) or (Continuous Deployment: proceed automatically)
→ Deploy to production
→ Run health checks
Deployment strategies that avoid downtime
A naive deploy — stop the old version, start the new one — causes visible downtime. Production backends typically use one of:
- Rolling deployment — replace instances one at a time behind a load balancer, so some capacity is always serving traffic.
- Blue-green deployment — run the new version ("green") fully alongside the old ("blue"), then switch traffic over all at once; if something's wrong, switching back is instant.
- Canary deployment — send a small percentage of real traffic to the new version first, watch its error rate and latency, and only roll it out fully if it looks healthy.
Why this matters for a backend specifically
A backend deploy is riskier than a static frontend deploy — a bad backend release can corrupt data, break every client hitting the API simultaneously, or take down a service other systems depend on. CI/CD doesn't eliminate that risk, but it makes every deploy consistent, tested the same way every time, and reversible — a rollback is redeploying the previous known-good image, not manually reconstructing what changed.
With code reliably reaching production, the final lesson pulls the pieces of this course together into what it actually takes to run a backend service end to end.