liveBook · Manning

Independent deployment

As explained in Microservices Patterns, Second Edition

A deployment arrangement in which application modules are packaged and released as independently deployable services.

Independent deployment lets a team build, test, and release a service without releasing other services. It is more than packaging code separately: the service needs its own deployment pipeline and must be production-ready after testing in isolation. This reduces release coordination and helps teams deliver changes quickly. section 1.3.1 section 7.3.1

An independently deployable service has three essential properties:

  • It is a deployable unit, such as an executable JAR, container image, operating system executable, or ZIP containing an AWS Lambda function. A library that must be packaged with other libraries is not enough. section 7.3.1
  • It has its own pipeline to build, test, and deploy it. A shared pipeline can require team coordination and let one service’s failed tests block another’s release. section 7.3.1
  • It can be considered production-ready after tests run in isolation, rather than depending on end-to-end tests involving other services. section 1.3.1 section 7.3.1

Loose design-time coupling supports independent deployment: a change to one service should rarely require a change to another. Without independent deployment and loose coupling, a system risks becoming a distributed monolith, combining distributed-system complexity with coordinated-release friction. section 1.3.1 section 7.3

Application-level acceptance tests can undermine independence when they span services. Replace them with service-level acceptance tests that exercise each service in isolation, using knowledge of how services collaborate. If services cannot be tested independently, improve the architecture or consider a monolith instead. section 7.5.5

Figure 7.10 Acceptance tests that span multiple services and would be end-to-end tests must be refactored to service-level acceptance tests that test each service in isolation.
eliminating application level acceptance tests

The diagram contrasts cross-service acceptance tests with tests run separately for each service. section 7.5.5

Sequencing an API change

Suppose an Order Service needs the Consumer Service’s reserveCredit() response to include available credit. Existing clients can ignore the new property, but the updated Consumer Service must be deployed before the Order Service uses it. For a breaking change, introduce a new API version alongside the old one, migrate clients, then remove the old version. Independent pipelines do not eliminate coordination for changes spanning services. section 7.5.2

Separate services can also isolate critical functionality on highly available infrastructure, or use different technology stacks and upgrade them incrementally. These benefits come with costs: operations spanning services must handle network failures, latency, availability, and transaction boundaries. Use independent deployment where its delivery and isolation benefits justify that complexity. section 1.3.3 section 1.3.4

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines deployable units, dedicated pipelines, and isolated readiness testing, then explains acceptance-test changes and cross-service rollout sequencing.
Examples
Illustrates order and consumer services with a credit-reservation API change and acceptance tests for credit and customer outcomes.
What you can do after
Evaluate whether service packaging, pipelines, tests, and cross-service changes support independent releases.
How it connects
Connects independent deployment to loose coupling, microservices, deployment pipelines, acceptance testing, and the distributed monolith antipattern.

Also explained in

Compare how 2 books explain independent deployment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.