Pipeline & Application Architecture

A guide to improving your delivery pipeline and application architecture for Continuous Delivery

This guide provides steps and best practices for improving your delivery pipeline and application architecture. Please review the CD Getting Started guide for context.

1. Build a Deployment Pipeline

The first step is to create a single, automated deployment pipeline to production. Human intervention should be limited to approving stage gates where necessary.

Entangled Architecture - Requires Remediation

Entangled Architecture

Common Entangled Practices

  • Team Structure: Feature teams focused on cross-cutting deliverables
  • Development Process: Long-lived feature branches
  • Branching: Team branches with daily integration to trunk
  • Testing: Inverted test pyramid common
  • Pipeline: Focus on establishing reliable build/deploy automation
  • Deploy Cadence / Risk: Extended delivery cadence, high risk

Entangled Improvement Plan

Find architectural boundaries to divide sub-systems between teams, creating product teams. This will realign to a tightly coupled architecture.

Tightly Coupled Architecture - Transitional

Tightly Coupled Architecture

Common Tightly Coupled Practices

  • Team Structure: Product teams focused on decoupling sub-systems
  • Development Process: Continuous integration
  • Branching: Trunk-Based Development
  • Testing: Developer Driven Testing
  • Pipeline: Working towards continuous delivery
  • Deploy Cadence / Risk: More frequent deliveries, lower risk

Tightly Coupled Improvement Plan

  1. Extract independent domain services with well-defined APIs
  2. Consider wrapping infrequently changed, poorly tested components in APIs

Loosely Coupled Architecture - Goal

Loosely Coupled Architecture

Common Loosely Coupled Practices

  • Team Structure: Product teams maintain independent components
  • Development Process: Continuous integration
  • Branching: Trunk-Based Development
  • Testing: Developer Driven Testing
  • Pipeline: One or more independently deployable CD pipelines
  • Deploy Cadence / Risk: On-demand or immediate delivery, lowest risk

2. Stabilize the Quality Signal

After establishing a production pipeline, focus on improving the quality signal:

  1. Remove flaky tests from the pipeline
  2. Identify causes for test instability and take corrective action
  3. Bias towards testing enough, but not over-testing
  4. Track pipeline duration and set a quality gate for maximum duration

3. Continuous Improvement

Use the Theory of Constraints (TOC) to continuously improve your delivery process:

  1. Identify the system constraint
  2. Decide how to exploit the constraint
  3. Subordinate everything else to the above decisions
  4. Elevate the constraint
  5. If a constraint is broken, return to step one

Common constraints include:

  • Resource Constraints: Limited capacity of people or environments
  • Policy Constraints: Policies or practices that impede flow

Further Reading

Title Author
Accelerate Forsgren, Humble, & Kim - 2018
Engineering the Digital Transformation Gruver - 2019
A Practical Approach to Large-Scale Agile Development Gruver et al - 2012
Theory of Constraints Goldratt
Last modified September 26, 2024: chore: improve images and seo (dc539dd)