CI/CD Lesson 7 – CI VS CD | Dataplexa
Section I · Lesson 7

CI vs CD

In this lesson

Where CI Ends Where CD Begins The Handoff Moment Why the Distinction Matters Common Misconceptions

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

Continuous Integration
Continuous Delivery / Deployment
Question: Does this code work?
Question: Can this code ship?
Triggered by every commit, every branch
Triggered by merges to the main branch only
Must finish in under 10 minutes
Can take 20–40 minutes — depth matters more than speed
Output: a green or red build signal
Output: a versioned artifact in production (or ready for it)
Audience: the developer who made the change
Audience: users in production

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

💬
"We have CI/CD" — but releases still take a week to prepare
This team has CI. They run automated tests on every commit. But CD is missing — nothing is being automatically promoted through environments. The "CD" part of their pipeline is still a manual, calendar-driven release process. Having CI does not mean you have CD.
💬
"We automated our deployments" — but production breaks every release
This team has CD. They have automated deployment scripts and environments. But CI is broken or absent — changes are not being continuously verified, test coverage is thin, and the builds being deployed are not trustworthy. Having CD does not fix broken CI.
💬
"CI/CD is just one thing" — the team treats it as a single toggle
This team installed a platform, created a YAML file, and declared themselves done. They have a pipeline, but it does not have the right stages for the right purposes. CI checks are too slow because acceptance tests were bolted on. CD is too shallow because only unit tests run there. Treating CI/CD as one indistinguishable thing produces a pipeline that is bad at both.

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

T + 0:00
Commit pushed. CI pipeline fires immediately — compile, unit tests, lint, security scan. This is CI's job.
T + 6:00
CI passes. Green build. Artifact created — v4.12.0. Developer gets a notification and moves on. CI hands off to CD.
T + 6:30
CD takes the artifact and deploys it to staging. Integration tests run. End-to-end scenarios run. This is CD's job.
T + 28:00
All staging checks pass. Approval gate appears (Continuous Delivery) — or production deploy fires automatically (Continuous Deployment). Still CD's job.
T + 29:00
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

CI asks "does it work?" — CD asks "can it ship?" They are different questions, answered by different stages, running at different speeds. Neither is a subset of the other.
The handoff is the artifact — when CI produces a versioned, immutable artifact, CD takes it and promotes it through increasingly realistic environments. The artifact is the proof of work that links both pipelines.
CI is fast, CD is deep — CI must complete in under 10 minutes on every commit. CD can take 30–40 minutes because it runs less frequently and thoroughness matters more than speed.
Having CI does not mean having CD — automated testing on every commit is CI. Automated promotion through environments to production-ready state is CD. Many teams have one and not the other.
Having CD does not fix broken CI — automating deployment of unverified code ships unverified code to production faster. CD is only as trustworthy as the CI that feeds it.
Never put acceptance tests in CI — they belong in CD. Putting slow, deep checks into the CI stage destroys the fast feedback loop that makes CI work in the first place.
When both work well, neither is visible — the developer pushes, things happen automatically, the change is live. The invisible pipeline is the successfully designed pipeline.
CI triggers on every commit; CD triggers on main merges only — this difference in trigger scope is what keeps CI fast and CD authoritative. Mixing the triggers produces noise in both directions.

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.