10. Continuous Delivery, Deployment and DevOps

The Deployment Problem

The ‘It works on my machine’ problem.

Deployment Antipatterns

Doing it manually:

Waiting until the very end to deploy a release:

More Releases

Increase release frequency: you will either suffer more or find a way to make it easy.

Continuous Integration:

Benefits of Continuous Delivery:

Deployment Strategies

Adequate preparation.

You need to:

Automate as much as possible:

Create a disaster recovery process (e.g. rolling back DB to previous schema)

Configuration Management

Keep everything under version control:

Think about dependencies: automated dependency retrieval is handy, but try to avoid having to ‘download the internet’.

Deployment Pipeline

After each stage, review the results/metadata from the pipeline.

Store the last few binaries in the artefact repository so that you can easily rollback.

Practices

Build only once:

Creating Deployment Strategies

Zero Downtime Releases

Negate as much downtime as possible (or at least, during peak times).

Hotplug facilities exist:

If not possible:

Blue-Green Deployment

In distributed systems e.g. web apps, re-routing is easy and it is possible to have multiple versions available at the same time.

Have two identical environments, blue and green for each server type (e.g. web server, application server, database server), using a router to determine which slice is being used at any given time.

Canary Deployment

Real-world systems are not easily cloneable:

Hence, use canary deployment development: