liveBook · Manning

Microservice

As explained in Grokking Software Architecture

A microservice is an independently deployable service aligned with a specific business capability and communicating with other services through defined interfaces.

Imagine an inventory team waiting to release a fix because the billing team’s build is broken. Microservices offer another arrangement: each team can deploy its service without joining the same release queue. That freedom is useful, but it comes with a network full of new responsibilities. section 12.2.3 section 12.2.2

A microservice is an independently deployable service organized around a specific business domain. Services communicate through defined interfaces over the network, rather than sharing memory or a database. Each can be updated and scaled independently—for example, adding inventory instances without scaling billing. section 12.2.2 section 12.2.6

Figure 12.1 The Architecture Spectrum. Moving to Microservices is a two-step evolution. You must first decouple your internal logic using strict interfaces (The Modular Monolith) before you safely decouple your infrastructure across a network.

The architecture spectrum shows why separating internal logic with strict interfaces can come before separating services across a network. section 12.2

A monolith deploys as one application; a modular monolith keeps strict internal boundaries while retaining that single deployment. Microservices add independent deployments, but also require more monitoring, deployment infrastructure, network security, and coordination of distributed data. Separating deployables without separating their logic—for example, keeping a shared database or long synchronous HTTP chains—creates a distributed monolith. section 12.11 section 12.2.2

Microservices are most compelling when a specific need justifies that premium:

  • Team autonomy: separate release schedules can relieve deployment queues as an engineering organization grows. section 12.2.3
  • Asymmetric scaling: a video transcoding service can use GPU servers while user profiles run on cheaper infrastructure. section 12.4.2
  • Different technology needs: services can use different languages or databases while exchanging data over standard protocols. section 12.4.3
  • Security and regulatory isolation: a dedicated payment service and database can reduce the scope of a breach or audit when properly isolated. section 12.4.4

A costly early split

Suppose a new product later merges guest users and paying customers into one account. In a monolith, the change can be made across one codebase and database. Across services, it may also require API contract changes, data migrations, and coordinated deployments. Independent services make some releases easier, but cross-boundary changes can become harder. section 12.3.2

For a new project, start with a monolith unless there is a strong reason to pay the distributed-system premium. If the need for independent services emerges, enforce internal boundaries first. A Strangler Fig migration can then route traffic gradually from the legacy application to new services; moving data remains a major challenge. section 12.11 section 12.2

How Grokking Software Architecture covers it

How deep it goes
Explains service boundaries, selection triggers, operational costs, and incremental migration; stops short of deep server administration.
Examples
Uses deployment queues, GPU-based video transcoding, and an account merger to illustrate benefits and costs.
What you can do after
Evaluate whether independent services justify their operational premium for a project's team, scaling, technology, and isolation needs.
How it connects
Connects microservices to modular monoliths, Conway's Law, distributed monoliths, and the Strangler Fig pattern.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.