LVD Inside a Single Microservice

"It's only a small service, it doesn't need layers." You hear it at the start of nearly every microservice project, and it is half right. A small service does not need nine layers. But it still contains code that changes at very different speeds, and treating it as one undifferentiated lump is how small services turn into hard-to-change large ones.

The forces don't care about deployment size

Take a loyalty-points service. It has data definitions that almost never change, a few calculation helpers that change occasionally, an integration with a payments partner that changes whenever the partner revises its API, and earning rules that marketing edits every month. That is the whole volatility spectrum, packed into a few thousand lines.

The book's position is that microservices are no exception to the forces LVD responds to. Inside each service, import edges should respect the dependency rule, and the volatility ordering of the layers should hold in practice. Its definition of an LVD-structured service goes as far as asking that the ordering hold over any six-month measurement window, which turns a style preference into something you can check against version history.

Use the layers you need

The other half of the answer is that "LVD-structured" does not mean "all nine folders present". The book sets a floor of three layers for any microservice:

  • Schema (L1), because every service has request and response contracts.
  • Resources (L3), because every service integrates with something external, whether a database, an upstream service or a broker.
  • Tools (L4) or API (L5), because every service has to expose behaviour in some form, either as callable tools or as an HTTP or gRPC endpoint.

Everything else is conditional, and the reasons are intuitive. Add Utils when the service has non-trivial computation. Add Tools when there is business logic beyond simple data access. Add the API layer when the service speaks HTTP or gRPC, and leave it out when the service communicates purely through events. Add MCP only if AI agents must be able to invoke the service, Skills only if agent workflows need procedural guidance, and Agents only when the service itself is an autonomous agent.

Two sizes, side by side

A thin address-lookup service that wraps a single mapping provider might need just schema definitions, a resource that talks to the provider, and an API endpoint. Three layers, and each earns its place. The loyalty-points service above, with its earning rules and tier arithmetic, would add Utils for the pure calculations and Tools for the business operations, then an API on top. If it later has to be callable by a customer-support assistant, an MCP layer joins the stack. The structure grows because the service grows, not because a template demanded it.

This sidesteps a common objection to layering in microservices, which is that the ceremony outweighs the benefit. The ceremony only applies to layers that have something to hold. Ignoring that is what the book calls over-layering.

What consistency buys you across services

The payoff of applying one structure everywhere is organisational as much as technical. The book lists four benefits:

  • An engineer moving between services finds a familiar layout and familiar dependency rules.
  • Linting, generators and CI pipelines are written once and applied to every service.
  • Tests are predictable by layer: pure functions need no mocks, integration tests target resources, and behavioural tests target tools.
  • Architecture reviews can lean on automated checks instead of subjective impressions.

The takeaway

Treat each microservice as a miniature of the whole system: three layers at minimum, more as the service earns them, and the same one-way dependency rule throughout. That keeps services small in the way that matters, which is easy to change, rather than merely small on disk. For the wider comparison, see LVD versus microservices, and for what happens when services start talking to each other, cross-service concerns under LVD.

What the book covers

  • The formal definition of an LVD-structured microservice
  • A complete annotated directory layout for a mid-sized Order Service
  • The full decision table for including or omitting each layer
  • Four organisational benefits of using one structure in every service
  • How the four core metrics apply uniformly across services