liveBook · Manning

Chapter 13: Architecting for the Delivery Lifecycle (CI/CD): Building Automated Gates for High-Velocity Software Delivery

What you will learn in chapter 13 of Grokking Software Architecture

This chapter introduction previews the delivery-lifecycle topics covered later in the chapter.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduction previews the delivery-lifecycle topics covered later in the chapter.

Introduction

This introduction reframes software architecture as responsibility for getting changing software safely and quickly into production, not just designing its structure.

Key terms: delivery lifecycle, Clarity Engineer, deploy, Continuous Integration, Continuous Delivery, CI/CD

13.2 Designing for Deployability: Why Architecture Dictates Your Release Pipeline

This section argues that deployability is an architectural concern and shows how system structure and infrastructure scale shape the release pipeline.

Key terms: deployability, first-class architectural concern, -ility, build pipeline, deployment pipeline, single, unified artifact, rolling upgrades, health checks, load balancer target groups, Microservice Premium

13.3 Deployment Strategies: Shifting Traffic Without Breaking Hearts

This section contrasts disruptive Big Bang deployments with a zero-downtime approach that keeps the old version running while traffic moves to the new one.

Key terms: Big Bang Deployment, Recreation strategy, zero-downtime architecture, SLAs, isolated environment, routers, load balancers, API Gateway, user traffic

13.3.1 Rolling Updates: The Assembly Line

Explains how rolling updates replace service instances incrementally and why their low infrastructure cost comes with a period when two versions serve traffic.

Key terms: Rolling Update, load balancer, health checks, Dual-Version problem, database schema, parallel production environment

13.3.2 Blue-Green Deployment: The Parallel Worlds

Explains how blue-green deployment switches traffic between two production environments, enabling testing and fast rollback while introducing cost and data-divergence risks.

Key terms: Blue-Green Deployment, Blue, Green, API Gateway, Load Balancer, rollback, Data-Divergence Trap, data synchronization, database alignment, Infrastructure Premium

13.3.3 Canary Deployments: The Early Warning System

This section explains how canary deployments limit release risk by testing new code with a small share of live traffic, then either stopping or expanding the rollout based on its behavior.

Key terms: Canary Deployment, blast radius, live user traffic, dual-version environment footprint, Session Affinity, Data Divergence, Expand/Contract Pattern, non-destructive sequence

13.3.4 Deployment vs. Release: The Feature Flag Distinction

This section shows how feature flags separate deploying code from releasing functionality, enable dark launches, and require cleanup to avoid flag debt.

Key terms: Deployment, Release, Feature Flag, Separation of Concerns, Dark Launch, Feature Flags, internal QA testers, Flag Debt, Mandatory Expiration Metadata (TTL), Telemetry-Driven Stale Flag Audits

13.3.5 How Do I Decide Which Deployment Strategy is Best?

This section explains how to choose a deployment strategy based on constraints and why safe traffic routing does not replace checks on code structure.

Key terms: Rolling Updates, Blue-Green, Canary Deployments, blast radius containment, Infrastructure Resource Cost, Operational Complexity, database write-divergence, Green zone, Blue zone, infrastructure routing

13.4 Architecture Governance: Automated Guardrails

This section explains why faster code generation and fallible human review make automated architectural guardrails necessary in the delivery pipeline.

Key terms: generative AI code assistants, boundary leaks, architectural boundaries, structural checking mechanisms, architecture governance, Automated Guardrails, continuous delivery pipeline, architectural erosion

13.4.1 Paying Off the Receipt: Architectural Fitness Functions

This section explains how architectural fitness functions turn design rules into automated checks of a codebase.

Key terms: Architectural Fitness Function, intentional design blueprints, Downward Dependency Rule, NetArchTest, ArchUnit, class relationships, package dependencies

13.4.2 Enforcing Boundaries in the Code

This subsection shows how architectural rules for an Order Service can become tests that block structural regressions in CI.

Key terms: Domain Layer, infrastructure layer, presentation layer, *Controller, standard test suite, CI pipeline, structural regression, Pull Request

13.4.3 The Database Evolution: The Expand/Contract Pattern

This section explains how to evolve a shared database without downtime or data divergence while old and new application versions run during deployment.

Key terms: zero-downtime deployment, dual-version risk, backward compatibility, Expand/Contract Pattern, Parallel Change, Expand Phase, Transition Phase, Contract Phase, dual-write, data divergence

13.4.4 Common Pitfalls When Setting Up Automated Guardrails

This section explains how to introduce automated architectural guardrails without overwhelming a team, making them ineffective, or freezing work on legacy code.

Key terms: Perfect Architecture Trap, Fitness Functions, boundary constraint, Silent Killer Gate, architectural fitness functions, blocking switches, Ratchet Gate, Racheting, Boy Scout Rule, historical technical debt

13.5 Diagram: CI/CD Pipeline: The Conveyor Belt of Truth

This section sketches the Order Service code change’s path through automated quality gates to an immutable artifact and zero-downtime deployment.

Key terms: Order Service, linting, security scanning, unit testing, Fitness Functions, immutable container artifact

13.5.1 Walking Through the Automated Machinery

Traces an Order Service change through the automated pipeline, from a code push and CI checks to a packaged container and blue-green deployment.

Key terms: Commit Trigger, webhook, pipeline runner, Guardrail Gauntlet (CI), Linting & Formatting, Unit & Integration Tests, Assembly Step, immutable package, container, unique identifier

13.5.2 Architectural Philosophy: Roll Forward vs. Rollback

This section compares rollback and roll-forward recovery after a production bug and explains why the full pipeline recovery time determines which approach is safe.

Key terms: Rollback Strategy, Roll Forward Strategy, known stable container image, data divergence, Roll Forward Lead Time, Mean Time to Repair (MTTR), Governance Gates, Cluster Promotion & Health Probes

13.6 Code Snippet: GitHub Actions YAML

This section presents a GitHub Actions workflow as a pipeline defined in code, emphasizing its repeatable stage-gate structure rather than its YAML syntax.

Key terms: pipeline as code, declarative configuration files, YAML, ClickOps, stage-gate logic, automated boundaries, unchangeable artifact, geographical constraints, organizational trust, code artifact

13.7 Environment Promotion as Architectural Confidence

This section explains how promoting one verified artifact through environments builds deployment confidence, then weighs staging against controlled testing in production.

Key terms: Environment Promotion, immutable container artifact, SHA hash signature, configuration drift, Pre-Production Gateway, Staging Environment, Testing in Production, production parity, Dark Launching, Canary Deployments

13.7.1 The Defensive Toolkit: Navigating the Staging Conversation

Provides a decision rule for defending when a team needs a traditional staging environment and when it can safely validate changes in production.

Key terms: traditional staging tier, physical staging gate, blast-radius controls, High-Confidence Automated CI/CD Testing, Strict Service Decoupling, Ephemeral Preview Environments, Fine-Grained Production Routing Controls, production landing layers

13.8 DORA Metrics: Your Architecture's Report Card

The section uses four DORA metrics to show how architectural choices affect delivery speed and production stability together.

Key terms: DORA metrics, Velocity, Stability, automated guardrails, architecture's report card, Velocity Axis, Deployment Frequency, Lead Time for Changes, Stability Axis, Change Failure Rate

13.9 The Dork Side: The $440M Deployment Error

Introduces Knight Capital’s 2012 collapse as a costly example of a delivery process without automated deployment verification.

Key terms: automated deployment verification, delivery process, legacy delivery culture

13.9.1 The Setup: Reviving a Dead Engine

The section sets up the Knight Capital incident by showing how reused dormant code and an unverified manual deployment left one production server out of sync.

Key terms: manual file transfers, deployment verification check, step-gate logic, active environment, PowerPeg, dead code, flag, configuration parameter

13.9.2 The Autopsy: 45 Minutes of Unchecked Fire

This section traces how one outdated production server triggered destructive trading and how an undiagnosed response spread the failure across Knight Capital’s fleet.

Key terms: old binary, PowerPeg, Server 8, fine-grained observability metrics, automated deployment validations, legacy configuration

13.9.3 The Architectural Retrospective: What Went Wrong and How to Prevent It

This section uses the Knight Capital failure to show how deployment verification, automated rollout, traffic routing, and code-boundary checks make releases safer.

Key terms: automated validation gates, automated target checks, matching build tag, environmental verification, ClickOps, immutable container image, image signature, automated deployment engine, Cattle, Pets

13.9.4 Defending "-ilities" Against Short-Term Feature Pressure

The section shows how to defend deployment safety under feature-deadline pressure by expressing its business risks, making tradeoffs explicit, and recording the decision.

Key terms: automated guardrails, validation gates, financial & operational risk, Tradeoff Triangle, Speed to Ship, Cost to Operate, Deployability/Reliability, Change Failure Rates, Time to Restore Service (MTTR), Architecture Decision Record (ADR)

13.10 Your "In Action" Mission: Diagramming CI/CD

Introduces a hands-on assignment to design a CI/CD pipeline diagram.

13.10.1 The Scenario

The Shop-Zilla scenario shows how unsafe delivery practices can cause outages even after an architectural migration.

Key terms: Event-Driven Architecture, ClickOps, API contracts, database locking

13.10.2 Your Objective

Sets a three-phase blueprint exercise for Shop-Zilla’s Order Service delivery pipeline without explaining the steps needed to complete it.

13.10.3 The Shop-Zilla Blueprint Canvas Template

This subsection asks the reader to complete a Shop-Zilla delivery blueprint and explains the limit of what a safe deployment pipeline can guarantee.

Key terms: Draw.io, Mermaid, Phase 3, traffic-routing channels, blueprint canvas, safe conveyor belt, production, execution states

13.11 Checklist

This checklist prompts readers to recall delivery architecture ideas covered earlier in the chapter, without teaching new concepts.

13.12 Recap

The recap connects deployable code structure with safe rollout strategies, automated safeguards, staged promotion, and delivery metrics.

Key terms: Deployability, Rolling Updates, Blue-Green Deployments, Canary Deployments, blast radius, Deployment, Release, Dark Launching, dynamic data toggles, Expand/Contract Pattern

Concepts explained in this chapter

← Chapter 12: The Great Debate: Monoliths vs. Microservices— Navigating the Distributed Divide

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.