CI/CD Course
CI vs CD
In this lesson
CI and CD are not two names for the same thing. They are two distinct practices that operate on different parts of the software delivery pipeline, at different speeds, with different goals. Continuous Integration is about keeping code healthy — merging often, building fast, catching bugs while they are cheap. Continuous Delivery and Deployment are about keeping software shippable — packaging what CI verified, moving it through environments, and getting it in front of users. CI asks: "does this code work?" CD asks: "can this code ship?"
The reason this distinction matters is practical. Teams that conflate the two either build a CI system and call it "CI/CD" — then wonder why releases are still painful — or they set up a deployment pipeline without a solid CI foundation and end up automating the release of untested code. Getting both right requires understanding exactly what each practice is responsible for, and where the boundary between them sits.
Two Different Questions, Two Different Pipelines
Here is the clearest way to understand the split. When a developer pushes a commit, two questions need to be answered before that code can be in production. CI answers the first. CD answers the second. Neither can answer the other's question — and neither is complete without the other.
CI vs CD — The Fundamental Split
The Handoff: What Happens at the Boundary
The handoff from CI to CD is a specific, definable moment in the pipeline. It happens when a build passes CI and produces an artifact — a Docker image, a compiled binary, a packaged archive. That artifact is the baton being passed. CI created it. CI verified it. Now CD takes it and asks a harder question: not "does it work in isolation on a clean build machine" but "does it work in a real environment, against real dependencies, behaving the way a real user would experience it?"
This is why you should never rebuild the artifact at each environment — as warned in Lesson 5. The artifact is the proof of work. Rebuilding it breaks the chain of custody. What CD is doing is taking the exact thing CI blessed and subjecting it to increasingly realistic conditions until the team is confident enough to put it in front of real users.
The Test Kitchen and the Restaurant Analogy
CI is the test kitchen — a controlled environment where a chef (developer) tries out a dish (code change), tastes it, tweaks it, confirms the recipe works. The dish passes if it tastes right and uses the correct ingredients. CD is the restaurant service — the same dish, made to the same recipe, now prepared at scale, plated properly, served to actual diners, under real conditions. A dish that worked in the test kitchen can still fail in service if the kitchen is understaffed, if the oven temperature varies, if a key ingredient runs out. Both environments matter. Neither replaces the other.
Speed vs Depth: Why CI and CD Run at Different Tempos
One of the most practical differences between CI and CD is the speed at which they are expected to run — and why.
CI must be fast because it runs on every commit, and a slow CI pipeline is one that developers stop waiting for. The moment a developer decides to push another commit before the first build has finished, CI has lost. Ten minutes is the widely accepted upper limit — fast enough that a developer can make a coffee, come back, and still have the result fresh in their mind.
CD does not have the same constraint. It runs less frequently — only on merges to main — and its job is depth, not speed. Full end-to-end test suites against a production-like environment can legitimately take 20 to 40 minutes. That is acceptable because nobody is standing at their desk waiting for permission to continue working. CD runs in the background while the team moves forward. The output arrives when it arrives, and it is authoritative when it does.
This tempo difference is why mixing the two pipelines is a mistake. Teams that bolt their acceptance tests onto their CI pipeline create a 40-minute CI run that nobody waits for. Teams that run only fast unit tests in CD end up with a shallow delivery check that misses integration failures. Keep them separate. Let each one do its job at its own pace.
The Three Misconceptions That Cause Real Problems
Most CI/CD failure stories — teams that "adopted CI/CD" but still have painful releases, or teams that broke production repeatedly after automating their pipeline — trace back to one of three misconceptions about the CI/CD boundary. They are worth naming directly.
Three Misconceptions — and What They Actually Mean
A Full Picture: CI and CD Working Together
When CI and CD are both working properly — with the right checks in each, running at the right speed, on the right triggers — the experience for a developer is almost invisible. They push code. Something happens automatically. Some time later, that code is live. The machinery is transparent. That invisibility is the goal.
CI + CD End to End — One Commit's Journey
v4.12.0. Developer gets a notification and moves on. CI hands off to CD.v4.12.0 is live. The developer has been working on something else for 23 minutes. They never thought about this deployment. That is the goal.Warning: Do Not Mix CI and CD Checks in the Same Pipeline Stage
Running acceptance tests, load tests, or full end-to-end suites inside the CI stage is one of the most common pipeline design mistakes. It makes CI slow — sometimes catastrophically slow — which means developers stop waiting for it, which means the fast feedback loop that makes CI valuable collapses entirely. CI checks belong in CI. Acceptance tests belong in CD. The 10-minute CI rule exists precisely to enforce this separation. If your CI run takes 45 minutes, the first question to ask is: "what CD-level checks did we accidentally put in here?"
Key Takeaways from This Lesson
Teacher's Note
Next time someone says "our CI/CD is broken," ask which one — because the fix for a broken CI and the fix for a broken CD are completely different conversations.
Practice Questions
Answer in your own words — then check against the expected answer.
1. What is the name for the versioned, immutable package that CI produces and passes to CD — the "baton" that links the two pipelines and must never be rebuilt at each environment?
2. CI triggers on every commit. CD triggers only on merges to the main branch. Why is this difference in trigger scope important for keeping CI fast?
3. A team complains their CI pipeline takes 45 minutes. The most likely cause is that they accidentally placed which type of test — which belongs in CD — inside their CI stage?
Lesson Quiz
1. A senior engineer says "our CI passes so we're good to deploy." What is the gap in this reasoning?
2. A team automated their deployment process completely but skipped building a proper CI system — they merge rarely, have few automated tests, and treat deployment scripts as their quality gate. What is their actual situation?
3. Why is a 10-minute limit imposed on CI but not on the CD pipeline, which can legitimately run for 30–40 minutes?
Up Next · Lesson 8
CI/CD Pipeline Overview
You know what CI and CD each do. Now see the full pipeline assembled — every stage, every trigger, every decision point, mapped as one connected system.