Skip to main content

Architecture and scale

What are Microservices?

Definition

Microservices is an architecture that splits an application into small, independently deployable services, each owning its own data.

Also known as: Microservice architecture

Microservices in more detail

The defining property is independent deployability, not size. If two services must be released together, they are one service in two repositories and you are paying the network cost for nothing. Each service owns its data store outright — other services ask through its API rather than reading its tables — which is what allows a team to change a schema, a language or a release cadence without coordinating with anyone else.

That autonomy is bought with distributed-systems problems. Calls that used to be function invocations now fail, time out, retry and arrive twice, so every caller needs timeouts, backoff, circuit breakers and idempotent handlers. Transactions cannot span services, so consistency becomes eventual and is coordinated with sagas and outbox patterns. Debugging one user action means correlating traces across several systems, and a local development environment stops being a single process.

So the honest test is organisational. Microservices solve a coordination problem: many teams, each wanting to ship without waiting for the others, with parts of the system that scale differently. They are a poor answer for a small team on a young product, where the boundaries are still moving and every mistaken split becomes a network call that is expensive to undo. Extracting services from a working monolith along seams that have already proved stable is the lower-risk path.

Microservices example

Microservices — independent deployables, private data

  orders-svc ──HTTP──▶ payments-svc ──▶ payments DB
      │                     │
      │ publishes           │ publishes
      ▼                     ▼
   message broker (order.created, payment.captured)
      │
      ▼
  email-svc          shipping-svc ──▶ shipping DB

  orders-svc must NOT query the payments database directly.

What every caller now needs
  timeout + retry with backoff and jitter
  circuit breaker so a sick dependency is not hammered
  idempotency, because retries duplicate work
  a correlation id propagated through every hop

Microservices — common questions

How small should a microservice be?
Small enough that one team can own it and deploy it alone, and no smaller. The useful boundary is a business capability with its own data, not a line count — services that must always be released together should be merged.
Can microservices share a database?
It is possible and generally a mistake. A shared schema couples the services at their most brittle point, so a migration by one team can break another's deployment and you lose the independence the architecture exists to provide.
Should a new project start with microservices?
Rarely. Boundaries are hardest to identify early, and a wrong split becomes a network call between things that should have been one. Most teams do better starting with a well-modularised monolith and extracting services where the seams prove stable.

Keep reading

Every definition in the set is indexed A-Z in the developer glossary, and the cheat sheets cover the syntax once you know what you are looking for.

Browse the A-Z glossary