Skip to content

CI/CD architecture

Continuous integration (CI) means every change is merged frequently and automatically built and tested. Continuous delivery (CD) means every change that passes is ready to release at the push of a button; continuous deployment goes one step further and releases it automatically. The pipeline that does this is critical architecture: it decides how fast and how safely change reaches users, and it holds the keys to production.

The DORA research program (opens in a new tab) has shown for years that teams which deploy more often, with shorter lead times, also tend to have lower change failure rates and faster recovery. Speed and stability go together when the pipeline is designed well.

From commit to production1. Every commit is built once into a versioned, signed artifact and unit tested in minutes. 2. Security scans and policy checks run on the artifact, followed by integration and contract tests. 3. The same artifact is released progressively, to a small share of traffic first. 4. Production metrics decide whether the rollout continues or rolls back automatically. Commitsmall and frequent Build and unit testone signed artifact Security checksscans, policy Integration testsand contract tests Progressive releasecanary, feature flagsProductionmonitored1234
From commit to production One artifact is built once and promoted through stages; each stage adds confidence, and production releases go out progressively.
  1. Every commit is built once into a versioned, signed artifact and unit tested in minutes.
  2. Security scans and policy checks run on the artifact, followed by integration and contract tests.
  3. The same artifact is released progressively, to a small share of traffic first.
  4. Production metrics decide whether the rollout continues or rolls back automatically.
  • Build once, promote the same artifact. Rebuilding for each environment means production runs something that wasn’t tested. Configuration differs per environment; the artifact doesn’t.
  • Fast feedback first. Order stages so the quickest, most likely to fail checks run first. Aim for a commit-stage result in under ten minutes.
  • Trunk-based development with small changes and short-lived branches; long-lived branches make integration painful and releases risky.
  • Test in layers: unit tests, then contract tests between services, then a small number of end-to-end tests. Many slow end-to-end tests make the pipeline flaky and slow.
  • Separate deploy from release. Deploy code dark behind feature flags (opens in a new tab), then release to users gradually.
  • Progressive delivery. Canary or blue-green releases with automatic rollback on error-rate or latency regressions. See canary release.
  • Databases need care. Use backward-compatible schema changes (expand, migrate, contract) so code and schema can be deployed and rolled back independently.
  • Everything as code: pipelines, infrastructure (IaC) and policies, versioned and reviewed.

The pipeline can change production, so it’s a prime target for attackers.

  • Short-lived credentials for deployments, using workload identity federation rather than stored long-lived keys.
  • Least privilege per pipeline and environment; build jobs can’t deploy to production.
  • Protected branches and required reviews for anything that reaches production.
  • Dependency and image scanning, and pinning of third-party actions and plugins.
  • Signed artifacts and provenance, so production runs only what your pipeline built. The SLSA framework (opens in a new tab) describes levels of supply chain assurance.

Track the four DORA metrics: deployment frequency, lead time for changes, change failure rate, and time to restore service. They show whether pipeline changes are helping.

  • Manual approval gates as the main safety mechanism, which slow everything and catch little. Automated checks and progressive release catch more.
  • Flaky tests that teams learn to rerun until green, hiding real failures.
  • Different artifacts per environment.
  • A shared pipeline service account with admin rights everywhere.

Written and edited by Abhinav Taduka, enterprise software architect.