8 Deploying microservices

 

This chapter covers

  • Why it’s crucial to get deployment right in a microservice application
  • The fundamental components of a microservice production environment
  • Deploying a service to a public cloud
  • Packaging a service as an immutable artifact

Mature deployment practices are crucial to building reliable and stable microservices. Unlike a monolithic application, where you can optimize deployment for a single use case, microservice deployment practices need to scale to multiple services, written in different languages, each with their own dependencies. You need to be able to trust your deployment process to push out new features — and new services — without harming overall availability or introducing critical defects.

As a microservice application evolves at the level of deployable units, the cost of deploying new services must be negligible to enable engineers to rapidly innovate and deliver value to users. The added development speed you gain from microservices will be wasted if you can’t get them to production rapidly and reliably. Automated deployments are essential to developing microservices at scale.

8.1 Why is deployment important?

8.1.1 Stability and availability

8.2 A microservice production environment

8.2.1 Features of a microservice production environment

8.2.2 Automation and speed

8.3 Deploying a service, the quick way

8.3.1 Service startup

8.3.2 Provisioning a virtual machine

8.3.3 Run multiple instances of your service

8.3.4 Adding a load balancer

8.3.5 What have you learned?

8.4 Building service artifacts

8.4.1 What’s in an artifact?

8.4.2 Immutability

8.4.3 Types of service artifacts

8.4.4 Configuration

8.5 Service to host models

8.5.1 Single service to host

8.5.2 Multiple static services per host

8.5.3 Multiple scheduled services per host

8.6 Deploying services without downtime

8.6.1 Canaries and rolling deploys on GCE

Summary