Microservices Architecture in Cloud: How Small Services Work Together

Microservices Architecture in Cloud: How Small Services Work Together

Microservices architecture in cloud systems is a way of building an application as a suite of small services, each running in its own process and communicating through lightweight mechanisms such as HTTP APIs. The short answer is that instead of one large application doing everything, many small services each do one thing, own their own data, and can be deployed, scaled and changed independently of the others.

The style was defined by James Lewis and Martin Fowler in their article of March 2014, which described it as developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. A decade on, that definition still holds, and the cloud is where the style works best, because cloud platforms provide the containers, orchestration and networking that small services need. Our guide to Kubernetes architecture explains the platform most teams use to run them.

Key takeaways

  • Microservices architecture in cloud systems splits an application into small services, each owning one business capability and its own data.
  • Each service is deployed, scaled and changed independently, which lets teams release without waiting for each other.
  • The style was defined by James Lewis and Martin Fowler in March 2014.
  • The real costs are distributed-system complexity, data consistency and operational overhead.
  • Microservices suit large systems with several teams; a well-structured monolith usually suits a small team better.

What counts as a microservice

A microservice is defined by its boundaries, not its size. The service should own one business capability, such as orders, payments or customer accounts, and it should own the data that capability needs. Other services may use that capability only through the service’s published interface, never by reaching directly into its database. That rule is what keeps the services independent: a team can change how its service stores data without breaking anyone else.

There is no agreed size limit, and the name is misleading in that respect. Fowler and Lewis themselves warned that the name draws attention to size, which is not the point. A service can be a few hundred lines or a few thousand; what matters is that it is independently deployable and that it owns one clear responsibility. Best for: teams drawing service boundaries, because a boundary drawn around a business capability lasts longer than one drawn around a technical layer.

How services communicate

Services in a microservices system communicate over the network, and there are two main styles. Synchronous communication means one service calls another and waits for a reply, usually over HTTP. It is simple to understand and gives immediate answers, but it couples the services in time: if the called service is slow or down, the caller suffers too. Our guide to the service mesh microservices depend on explains how teams manage these calls.

Asynchronous communication means a service publishes an event or a message and moves on, and other services react when they are ready. It removes the timing coupling, so a slow consumer does not block the producer, but it introduces eventual consistency, because the system takes time to settle. Most real systems use both: synchronous calls where an answer is needed now, and events where the work can happen later. Best for: architects choosing between a call and an event, because the choice shapes failure behaviour more than any other decision.

Data ownership: one service, one database

The rule that each service owns its own data is the hardest part of the style to keep, and the most important. When services share a database, a change to one table can break several services, deployments become coordinated again, and the independence that justified the split disappears. The system becomes a distributed monolith: all the cost of distribution with none of the benefit.

Owning data separately has a price. A question that spans several services, such as a report combining orders, customers and payments, can no longer be answered with one database query. Teams solve this with patterns such as publishing events so other services can build their own read models, or using a saga to keep a multi-service process consistent. These patterns work, but they are real engineering that a monolith gets for free. Best for: teams that want the honest cost of the style before they commit to it.

Deployment and scaling, service by service

Independent deployment is the benefit teams feel first. A team can release its service on its own schedule, without coordinating a release train with every other team. A bug fix in the payments service ships in minutes, not at the next monthly release window. That speed is the main reason large organisations adopt the style.

Independent scaling is the second benefit. A service under heavy load can be given more instances without scaling the whole system, which is cheaper and more precise than scaling a monolith. In the cloud this usually means containers, orchestrated by a platform such as Kubernetes, with each service getting its own deployment, its own scaling rules and its own resource limits. Best for: systems where different parts face very different loads, such as a checkout service that spikes during a sale while the rest of the system stays quiet.

Aspect Monolith Microservices
Deployment One unit, released together Each service released on its own
Scaling Scale the whole application Scale each service separately
Data One shared database Each service owns its data
Failure One process, one failure domain A service can fail without taking the rest down
Complexity Code complexity inside one codebase Operational complexity across many services
Team structure One team, or teams sharing a release One team per service, releasing independently

The table shows that microservices move complexity rather than removing it. Code that was once a function call becomes a network call, and problems that were once debugging sessions become operational problems. Whether that trade is worth it depends on the size of the system and the number of teams working on it.

A printed architecture diagram on a desk showing many small connected service boxes arranged in a grid
Each microservice owns one business capability and its own data, and communicates with the others over the network.

The operational cost nobody should underestimate

Running many services means running many things: deployments, logs, metrics, alerts and dashboards for each one. A monolith has one deployment pipeline and one set of logs; a system of thirty services has thirty of each. Without centralised logging, distributed tracing and good dashboards, finding the cause of a problem becomes guesswork.

The network itself becomes a failure mode. Calls between services can time out, retry storms can overwhelm a struggling service, and a partial failure can leave the system in a state no single service understands. Patterns such as circuit breakers, timeouts and bulkheads exist to contain this, but they must be applied consistently across every service. This is why the style demands strong platform and operations skills, and why teams without them often struggle. Best for: organisations with a platform team or the budget to build one, because the style needs that investment to work well.

When microservices are the wrong choice

Microservices are the wrong choice when the system is small, the team is small, or the domain is not yet understood. A small team gains little from independent releases when the same people release everything anyway, and pays the full operational cost. A system whose boundaries are still unclear will be split in the wrong places, and moving a boundary between services is far harder than moving one inside a monolith.

The better starting point is usually a modular monolith: one deployment, but with strict internal boundaries, each module owning its data and exposing a clear interface. If the system grows and the boundaries prove right, modules can be extracted into services later, when the need is proven rather than predicted. Many successful microservices systems started exactly this way. Best for: new products and small teams, where learning the domain matters more than scaling the organisation.

Decision checklist: microservices or monolith?

  • Choose microservices when several teams need to release independently and waiting on each other is the bottleneck.
  • Choose microservices when different parts of the system face very different loads and need to scale separately.
  • Choose a modular monolith when the team is small, the domain is new, or the service boundaries are still unclear.
  • Confirm each service would own one business capability and its own data before splitting anything.
  • Check the team can run distributed tracing, centralised logging and per-service monitoring from day one.
  • Revisit the decision as the system grows, because the right answer at ten services may not be right at a hundred.

Frequently asked questions

How small should a microservice be?

There is no size rule. A microservice should be as small as one business capability requires, and no smaller. The test is whether it can be deployed, changed and scaled independently; if it can, its size is fine.

Do microservices need containers and Kubernetes?

Not strictly, but in practice almost always. Containers package each service with its dependencies, and Kubernetes schedules, scales and heals them. Running dozens of services without that tooling is possible but painful.

Can microservices share a database?

They should not. Sharing a database couples the services through the schema, so a change in one service can break others and deployments must be coordinated. Each service should own its data and expose it only through its interface.

What is a distributed monolith?

It is a system split into services that cannot change independently, usually because they share a database or call each other in tight chains. It pays the cost of distribution, such as network failures and operational overhead, without gaining the benefit of independent deployment.

How do microservices handle transactions across services?

With the saga pattern, which breaks a multi-service process into local transactions, each with a compensating action to undo it if a later step fails. There is no distributed transaction covering all services, so the system passes through temporarily inconsistent states. Our guide to container orchestration explained covers the platform side of running these services.

Latest articles

Scroll to Top