Continuous Deployment

Book description

Methods of delivering software are constantly evolving in order to increase speed to market without sacrificing reliability and stability. Mastering development end to end, from version control to production, and building production-ready code is now more important than ever. Continuous deployment takes it one step further. This method for delivering software automates the final step to production and enables faster feedback and safer releases.

Based on years of work with medium to large organizations at Thoughtworks, author Valentina Servile explains how to perform safe and reliable deployments with no manual gate to production. You'll learn a framework to perform incremental, safe releases during everyday development work, structured exclusively around the challenges of continuous deployment in nontrivial, distributed systems. Complete with interviews and case studies from fellow industry professionals.

Close the feedback loop and leverage the production environment to manage your end-to-end development lifecycle efficiently. This book helps you:

  • Take observability, performance, test automation, and security into account when splitting work into increments
  • Create a daily development plan that takes immediate deployments to production into account
  • Deploy work in progress to production incrementally without causing regressions
  • Use patterns to refactor live functionality and alter persistence layers
  • Test and release features in production using different feature toggle configurations

Publisher resources

View/Submit Errata

Table of contents

  1. Foreword
  2. Preface
    1. Who This Book Is For
    2. What You Need to Read This Book
    3. What This Book Will Cover
    4. Conventions Used in This Book
    5. O’Reilly Online Learning
    6. How to Contact Us
    7. Acknowledgments
  3. I. Continuous Deployment
  4. 1. Continuous Deployment
    1. Deploying Every Few Months or Years
    2. Deploying Every Few Days
    3. Deploying Continuously
    4. eXtreme Programming
      1. If It Hurts, Do It More Often
    5. DevOps
      1. The Barrier Between Dev and Ops
      2. Joining Dev and Ops
      3. Automation, Automation, Automation
    6. Continuous Integration
    7. Continuous Delivery
    8. A Final Gate to Production
      1. One Step Further: Continuous Deployment
      2. Implementation
    9. Implications
    10. Is It Dangerous?
    11. Summary
  5. 2. Benefits
    1. One-Piece Flow and Lean Manufacturing
      1. Origins of Lean Manufacturing
      2. Lean and Software Development
    2. DORA Metrics
      1. Throughput Metrics
      2. Stability Metrics
    3. Shifting Quality Left
      1. How Continuous Deployments Force a Quality Shift to the Left
      2. The Effects of Automating Quality Gates
    4. Summary
  6. 3. The Mindset Shift
    1. Defining a Change Versus Applying a Change
    2. Hiding Work in Progress
      1. Version Control Branches
      2. Execution Branches
    3. Distributed Systems
      1. Contracts Between Systems
    4. Contracts Between Paths to Production
      1. Adding New Features: When Order Matters
      2. Refactoring: When Timing Matters
    5. A Deployment Is Not a Release
      1. Releases
      2. Deployments
      3. Differences
      4. Overlap
    6. End-to-End Delivery Life Cycle
      1. Without Continuous Deployment
      2. With Continuous Deployment
    7. Summary
  7. 4. You Must Be This Tall
    1. Cross-Functional, Autonomous Teams
      1. Fast Decision Making
      2. Implementation Autonomy
      3. Frequent Integration
      4. Frequent Code Reviews
      5. Automated Code Analysis
      6. Test Automation
      7. Zero-Downtime Deployments
      8. Observability and Monitoring
    2. Stakeholder Trust
      1. How Do We Convince the Boss?
      2. When Are We Ready?
    3. Summary
  8. 5. Challenges
    1. Systems That Are Sensitive to Deployments
      1. Interruption of Long-Running Processes
      2. Sticky Sessions
      3. Invalidation of Client-Side Caches
      4. Scaling Interruptions
      5. A Constant Stream of Cold Instances
    2. User-Installed Software
      1. Desktop Applications
      2. Mobile Apps
      3. Appliances and Other Devices
      4. Libraries and Frameworks
    3. Regulated Industries
    4. Cognitive Load
      1. Overly Busy Path to Production
      2. Inattention During Deployments
      3. Breadth of Knowledge Required
      4. Steep Onboarding Curve
      5. Scheduling Development Work
    5. Summary
  9. II. Before Development
  10. 6. Slicing Upcoming Work
    1. Horizontal Versus Vertical Slicing
      1. Horizontal Slicing
      2. Vertical Slicing
    2. With Continuous Deployment
    3. Effective Vertical Slicing
      1. MVP
      2. INVEST
      3. Small Slices
    4. Example: The Groceroo Company
      1. The Feature: “Last-Minute Items”
      2. The User Interface
      3. The Admin Interface
      4. The Problems of Implementing with Horizontal Slicing
      5. Implementation with Vertical Slicing
    5. Summary
  11. 7. Building for Production
    1. Deployability Requirements
      1. Hiding with Feature Toggles
      2. Hiding with Expand and Contract
      3. Hiding in Version Control Branch
      4. Unhidden
      5. Pausing the Pipeline
    2. Testability Requirements
      1. High-Level Automated Tests
      2. Manual Exploratory Testing
    3. Observability Requirements
      1. Maintaining Logs and Metrics
      2. Maintaining Dashboards and Alerts
    4. Security Requirements
      1. New User Input
      2. Storing New Data
      3. New Dependencies
      4. New Infrastructure
    5. Performance Requirements
      1. New Network Requests
      2. Data Size
      3. Persistence Layer
    6. A (More) Complete User Story Template
    7. Example: Adding CFRs to Groceroo User Stories
      1. User Story 1: Add Simple Carousel
      2. User Story 2: Admin Area
      3. User Story 3: “Add to Basket” Button
      4. User Story 4: Quantity Selector
    8. Summary
  12. III. During Development
  13. 8. Adding New Features
    1. Our User Story
    2. The Groceroo Application
      1. Current State
      2. Target State
      3. How Do We Get There?
      4. Implementing with a Feature Toggle
    3. Summary
  14. 9. Refactoring Live Features
    1. Our Task
    2. The Product Identifier System
      1. The Problem
      2. The Solution
    3. Current State
      1. Frontend
      2. Backend
      3. Persistence
    4. Target State
      1. Frontend
      2. Backend
      3. Persistence
    5. How Do We Get There?
      1. Expand and Contract
      2. Multiple Layers: Inside Out
    6. Implementing with Expand and Contract
      1. Outer Expand Phase: The Product Table
      2. Migrating the POST /product Endpoint
      3. Migrating the GET /product Endpoint
      4. Migrating the Basket Table
      5. Outer Contract Phase: Cleaning Up the Product Table
    7. Summary
  15. 10. Data and Data Loss
    1. Our Task
      1. The Problem
      2. The Solution
    2. Current State
      1. Persistence
      2. Backend
    3. Target State
      1. Persistence
      2. Backend
    4. How Do We Get There?
      1. Failure Mode: Simultaneous Change
      2. Failure Mode: Simple Expand and Contract
      3. Solution: Temporary Database Trigger
      4. Solution: Double-Write
      5. Solution: Double-Read
    5. Implementing with Double-Write
      1. Deployment 1: Expand the Database Column
      2. Deployment 2: Double-Write to Both Columns
      3. Deployment 3: Synchronize the Data
      4. Deployment 4: Migrate Write and Read to Both Columns
      5. Deployment 5: Contract the Columns
    6. Implementing with Double-Read
      1. Deployment 1: Expand the Database Column
      2. Deployment 2: Double-Read and Migrate Write the Columns
      3. Deployment 3: Synchronize the Data
      4. Deployment 4: Migrate Read the Column
      5. Deployment 5: Contract the Columns
    7. NoSQL
      1. Migrate on Read
      2. Custom Batch Update
      3. Conclusion on NoSQL
    8. Summary
  16. IV. After Development
  17. 11. Testing in Production
    1. Why You Should Test in Production
      1. Data Volume Accuracy
      2. Data Shape Accuracy
      3. Realistic Request Patterns
      4. Realistic Incoming Traffic Volume
      5. Realistic Outgoing Traffic Volume
      6. Realistic Size and Number of Servers
      7. Realistic Application Configuration
      8. Realistic Network Configuration
      9. Real Version of Other Teams’ Services
      10. Real Version of Third-Party Services
      11. Lower Cost
      12. Better Data Hygiene
    2. How to Test in Production
      1. Feature Toggle Activation Strategies
      2. Challenges
    3. Life After Staging
    4. Summary
  18. 12. Releasing
    1. Antipattern: Big Bang Releases
      1. Comparing Before Versus After States
      2. Comparing Simultaneous States
    2. Antipattern: Partial Releases Through Partial Deployments
    3. Using Feature Flags for Releases
      1. Coordinating Feature Flag Releases in Distributed Systems
      2. Antipattern: Independent Flag State for Each Service
      3. Propagating Flag State Down the Call Chain
      4. Centralized Feature Flag State
    4. Canary Releases
      1. By Traffic Percentage
      2. By Device
      3. By Country
      4. By User Segment
    5. A/B Testing
      1. Analytics
      2. Experiment Best Practices
      3. Schedule Delivery Around Experiments
      4. Types of A/B Tests
    6. Do You Need a Canary Release or an A/B Test?
    7. Summary
  19. Conclusion and Next Steps
  20. V. Case Studies
  21. Case Study: AutoScout24
    1. AutoScout24’s Context
    2. Adoption of Continuous Deployment at AutoScout24
      1. Overcoming Organizational Obstacles
      2. Overcoming Technical Obstacles
    3. AutoScout24’s Implementation of Continuous Deployment
      1. How AutoScout24 Makes Continuous Deployment Safe
    4. How AutoScout24 Supports Junior Engineers
  22. Case Study: OTTO
    1. OTTO’s Context
    2. Adoption of Continuous Deployment at OTTO
      1. Working with Organizational Barriers
      2. Working with Technical Barriers
    3. OTTO’s Implementation of Continuous Deployment
      1. OTTO’s Path to Production
      2. How OTTO Makes Continuous Deployment Safe
      3. How OTTO Supports Junior Engineers with Continuous Deployment
      4. Links and Resources
  23. Case Study: N26
    1. N26’s Context
    2. Adoption of Continuous Deployment at N26
      1. Working Within Industry Regulations
      2. Working with Technical Barriers
    3. N26’s Implementation of Continuous Deployment
      1. How N26 Makes Continuous Deployment Safe
      2. How N26 Supports Junior Engineers
    4. Links and Resources
  24. Case Study: ClimatePartner
    1. ClimatePartner’s Context
    2. Adoption of Continuous Deployment at ClimatePartner
    3. ClimatePartner’s Implementation of Continuous Deployment
      1. How ClimatePartner Makes Continuous Deployment Safe
      2. How ClimatePartner Supports Junior Engineers with Continuous Deployment
  25. Case Study: Motability Operations
    1. Motability Operations’ Context
    2. Adoption of Continuous Deployment at Motability Operations
      1. Working with Organizational Barriers
      2. Working with technical barriers
    3. Motability Operations’ Implementation of Continuous Deployment
      1. How Motability Makes Continuous Deployment Safe
      2. How Motability Operations Supports Teams
  26. Case Study: REA Group
    1. REA’s Context
    2. Adoption of Continuous Deployment at REA
      1. Overcoming organizational barriers
    3. REA’s Implementation of Continuous Deployment
      1. How REA Makes Continuous Deployment Safe
      2. How REA Supports Junior Engineers with Continuous Deployment
  27. Case Study: Maze
    1. Maze’s Context
    2. Adoption of Continuous Deployment at Maze
      1. Overcoming Organizational Challenges
      2. Overcoming Technical Challenges
    3. Maze’s Implementation of Continuous Deployment
      1. How Maze Makes Continuous Deployment Safe
      2. How Maze Supports Junior Engineers with Continuous Deployment
  28. Case Study: TravelPerk
    1. TravelPerk’s Context
    2. Adoption of Continuous Deployment at TravelPerk
    3. TravelPerk’s Implementation of Continuous Deployment
      1. How TravelPerk Makes Continuous Deployment Safe
      2. How TravelPerk Onboards Engineers to Continuous Deployment
  29. Index
  30. About the Author

Product information

  • Title: Continuous Deployment
  • Author(s): Valentina Servile
  • Release date: July 2024
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098146726