Deployment

Shipping a running service without dropping requests: containers, graceful shutdown, health checks, rolling deploys and migrations that survive two versions at once.

Deployment Models

VM, container, managed container, function, PaaS and Kubernetes compared by the engineering problem each one is solving, not by the marketing category.

Q · What am I actually choosing between when I choose where my backend runs?
Containerizing a Backend

An image is a frozen filesystem plus an entrypoint; the interesting part is what your process must do once it is PID 1 with no shell around it.

Q · What does putting my backend in a container actually change about how it runs?
Graceful Shutdown
▶ lab

SIGTERM arrives, and the process has one job: stop taking new work, finish or cancel what it holds, release everything, and exit before it is killed.

Q · What must a backend process do between receiving SIGTERM and exiting, so that no request and no job is lost?
Rolling Deployments

Replacing instances a few at a time keeps the service up, and guarantees that two versions of your code run against one database at the same time.

Q · What must be true about my code for it to be safe to replace instances gradually?
Expand and Contract Migrations

Five steps that let a schema change survive a rolling deploy, because for the length of that deploy two versions of your code share one database.

Q · How do I change a database schema when old and new code will both be running against it?
Canary Deployments

Send a small slice of real traffic to the new version, compare it against the old on the same signals, and only then commit the fleet.

Q · How do I get evidence that a new version is good under real traffic before it serves all of it?
Blue-Green Deployments

Run two complete environments, cut traffic from one to the other, and cut back if it is wrong — while remembering that the database was never duplicated.

Q · When is it worth paying for two full environments to make rollback instant?
Mapping Services Across Cloud Providers
▶ lab

A translation table for the eight things a backend needs from a cloud — with the column that matters most being what the analogy gets wrong.

Q · My service needs compute, storage, a database, a cache and a queue. What is the equivalent of each on the provider we actually use?
Running a Backend on Kubernetes

What the application must do to be a well-behaved workload: honest probes, a termination sequence that races endpoint removal, resource requests that match reality, and no local disk.

Q · What does my application code have to get right for Kubernetes to run it well?
Serverless Backends

A per-invocation execution model that removes supervision and adds cold starts, execution limits and connection pressure — excellent for some workloads and wrong for others.

Q · What changes about writing a backend when the platform creates and destroys the process around each request?