LVD, Microservices and the Service Mesh: Two Separate Questions

Whenever a team starts talking about microservices, two questions tangle together: how should the code be organised, and how should it be deployed? They sound like one question and they are not. Keeping them apart is the most useful thing the book says about microservices, and it shows what a service mesh can and cannot do for you.

Structure is not topology

The book describes LVD as an internal discipline, and microservices as a strategy for deployment and scaling. The two are orthogonal. The same nine layers can partition one big codebase, each module of a modular monolith, or each independent service. Nothing about the layering changes with the box you ship it in.

The practical payoff is that the topology decision becomes reversible. In the book's account, pulling a module out into its own service is a deployment task rather than a redesign, because the module already has clear layer boundaries. Going the other way works too: fold services back together and each one simply becomes a module with its layers intact.

My reading of why this holds is that talking to the outside world is already confined to one place. When a module becomes a service, a call that used to cross a folder boundary becomes a call across a network, and in a layered codebase there is a natural home for that change: the Resources layer. A codebase where Tools reach into each other's internals has no such seam, and extracting from it is where the redesign work hides.

What a mesh takes, and what it leaves

A service mesh such as Istio or Linkerd runs sidecar proxies beside your services and handles network-level behaviour without touching application code. In the book's framing, this removes transport plumbing from the API layer, leaving it free for application concerns such as authentication and validation. Timeouts and retries become declarative configuration instead of middleware you maintain in every service.

One thing remains your job. A request that crosses five services needs a single trace, and the mesh can pass headers from one service to the next. Inside a service, though, somebody has to carry the trace context from the place the request arrives down to the place the next call leaves. The book assigns that to two layers: the API layer picks the context up, and Resources passes it on.

An async-local store is one way to carry it without threading a parameter through every function:

// shared/trace.ts
import { AsyncLocalStorage } from "node:async_hooks";
export const trace = new AsyncLocalStorage<{ traceparent: string }>();

// L5: open a scope when the request arrives
app.use((req, _res, next) =>
  trace.run({ traceparent: req.header("traceparent") ?? newId() }, next));

// L3: read from it when calling another service
const headers = { traceparent: trace.getStore()!.traceparent };

The book names context-object parameters and async-local storage as the usual options. The point to take away is the boundary: Tools, Utils and Schema stay unaware of tracing, so a business rule never has a reason to change because the observability stack did.

Where the decision really lives

If LVD does not decide between monolith and microservices, what does? The book says the answer comes from organisational and operational factors, such as how many people work on the system, how often each part must be released and how differently the parts need to scale. It offers a matrix for weighing them, and I would rather leave that table to the book than flatten it into a paragraph.

What I can say from general practice is that the question is easier to answer once the structural worry is off the table. Teams often choose microservices partly because they fear that a monolith cannot stay tidy. If the layers and their rules hold in either shape, the real discussion becomes the honest one: does the organisation need independent deployment badly enough to pay for the operational cost?

The takeaway

Treat LVD as how your code is shaped and microservices as how it is shipped, and let a mesh handle the wire while your own code carries the context. For more, see LVD versus microservices, migrating between topologies and resilience patterns in Resources.

What the book covers

  • A decision matrix comparing monolith, modular monolith and microservices
  • How Conway's Law maps onto platform-team and full-autonomy ownership models
  • How teams specialise by layer as a side effect of volatility
  • Mesh configuration that replaces retry and timeout middleware
  • Exercises on notification services, sagas and event schema evolution