Video in progress

What does "deploy a service independently" require in practice?

You must be able to release a new version of a service without coordinating with other services and without redeploying them. That takes backward compatible API changes, no shared database, and a separate build/deploy pipeline.

📖 Answer

Independence is the main promise of microservices. If, to release a new version of order, you have to coordinate with the payment and catalog teams and deploy all three in one night, you actually have a distributed monolith.

What you need:

  • A backward compatible API. The new version also works with old clients. A new field is added, and the old one isn't removed right away.
  • Its own database. A schema migration doesn't break other services.
  • A separate pipeline. Each service has its own repository (or its own build in a monorepo), its own tests, its own deploy.
  • Contract tests. "Does the API I provide match what clients expect?": check this before the deploy.

During a deploy, the old and new versions run together for a while (a rolling update). So every change has to survive this "mixed" period too; for example, a message the new version writes must be readable by the old version as well.