Accent colour
 
Shortcuts: press ?
 

What Is a Service Mesh? How Microservices Talk Safely at Scale

Muhammad Tahir December 05, 2026

Fifty services, one question: who is talking to whom?

A small startup has one application. A request comes in, the code runs, the answer goes out. Then the company grows. The application splits into services: one for users, one for orders, one for payments, one for search. Then each of those splits again. A few years later, there are fifty services, and a single request from a customer might pass through eight of them before an answer comes back.

At that point, a new set of problems appears, and they are all about the conversations between services rather than about any one service. How does the orders service find the payments service? What happens when the payments service is slow — does the whole request fail, or does it retry? How do you know the request came from a service you trust, and not from something pretending to be one? How do you find out which service is making everything slow?

Every team answers these questions at first by writing code inside each service: a little retry logic here, a little timeout there, a client library for service discovery, a logging call in every handler. It works, for a while. Then the company has fifty copies of the same logic, written in three languages, at different versions, by different people, and nobody can change how services talk to each other without changing fifty codebases. That is the problem a service mesh is built to solve: it takes the networking out of the application code and puts it in a layer of its own.

What a service mesh actually does

A service mesh is a dedicated layer of infrastructure that handles communication between services. Instead of each service managing its own connections, retries, encryption and monitoring, the mesh does it for them. The application code sends a request to a local proxy, and the proxy handles everything else: finding the destination, opening an encrypted connection, retrying if it fails, recording how long it took, and enforcing the rules about who may talk to whom.

The mesh has two parts. The data plane is the set of proxies, one sitting next to each service, that actually move the traffic. The control plane is the brain: it tells the proxies where the services are, what the rules are, and how to behave. When a new version of a service is deployed, the control plane tells the proxies. When a security policy changes, the control plane pushes the new rule to every proxy at once. The application code does not know any of this is happening. It just makes a request and gets an answer.

The idea is not new. The first widely used mesh, Linkerd, appeared in 2016, built by the company Buoyant. Istio, the best-known mesh today, was announced in May 2017 by Google, IBM and Lyft, and released its first stable version in July 2018. Both were answers to the same experience: companies that had moved to microservices discovered that the network between the services had become a system in its own right, and it needed managing as one.

A service mesh is not the same thing as an API gateway, though the two are often confused. A gateway sits at the edge of the system and handles traffic coming in from the outside world — from users and from other companies. A mesh handles traffic inside the system, between services that already trust each other, or should. A system can have both, and most large ones do. The gateway is the front door. The mesh is the corridors.

The sidecar, explained without the jargon

The part of a service mesh that confuses most people is the sidecar, and it is worth explaining plainly, because everything else follows from it.

A sidecar is a small proxy process that runs alongside each service, in the same container or the same machine. When the service wants to talk to another service, it does not connect directly. It sends the request to its own sidecar, on the local machine, and the sidecar forwards it to the other service's sidecar, which hands it to the service. The reply travels back the same way. The services never talk to each other directly. They talk to their sidecars, and the sidecars talk to each other.

The reason for this design is that the sidecar can do things the service should not have to do. It can encrypt the connection, so the traffic between services is protected even if the network is not. It can retry a failed request, or give up after a sensible number of attempts. It can record how long the request took and whether it succeeded. And it can do all of this without the service's developers writing a line of code for it, and without them even knowing it is there.

The usual sidecar proxy is Envoy, created at Lyft in 2016 and now a project of the Cloud Native Computing Foundation. Envoy is a general-purpose proxy that the mesh configures for each service: which services it may call, how many retries to allow, how long to wait before timing out. Istio, Linkerd and most other meshes use Envoy or a proxy built on similar ideas, and the differences between meshes are mostly about the control plane — how you configure the rules, and what extra features you get — rather than about the proxy itself.

The cost of the design is that every request now passes through two extra hops, one on each side, and each hop adds a little latency. In practice the added time is a few milliseconds, which most systems can afford. The cost that matters more is operational: there are now twice as many processes to run, monitor, and update as there are services. That trade-off — consistency in exchange for complexity — is the central decision in adopting a mesh, and it is the one teams most often underestimate.

What you get: traffic, security, and observability

A service mesh earns its place by doing three jobs, and each one is worth understanding on its own.

Traffic management is the first. A mesh can split traffic between versions of a service, which is how teams do canary releases: send 5% of requests to the new version, watch it for an hour, and then send the rest. It can retry a failed request, but only the safe kinds — a read can be retried, a payment should not be. It can set timeouts, so a slow service does not hold up the whole request, and it can shed load, refusing new requests when a service is overloaded instead of letting it fall over. It can also do circuit breaking: if a service starts failing, the mesh stops sending it traffic for a while, the way an electrical breaker stops current when a circuit overloads, and then tries again later. These are the patterns that keep a system of fifty services from cascading into a system-wide outage when one of them has a bad day.

Security is the second. The mesh can encrypt every connection between services with mutual TLS, which means each side proves its identity to the other with a certificate. No service can impersonate another, and no one listening on the network can read the traffic. The mesh can also enforce policies about who may call whom: the payments service may call the ledger, but the search service may not. This is often called zero trust, and the mesh is one of the more practical ways to build it, because the policy is enforced in the proxy rather than in each service's code. The zero trust architecture article on this blog explains the idea in more depth.

Observability is the third. Because every request passes through a proxy, the mesh can record everything: how long each call took, which ones failed, and which service called which. That gives a team three things that are hard to get any other way: metrics for every connection, logs of every request, and traces that follow a single request through all the services it touches. When a customer reports a slow checkout, the trace shows which service was slow, and the metrics show whether it is slow for everyone or just for that customer. Teams that have lived without this will recognise the difference: debugging a slow request across fifty services without traces is guesswork, and with traces it is a lookup.

The costs nobody mentions in the demo

Service meshes are usually sold on the features above, and the features are real. The costs are real too, and they are the reason many teams that adopt a mesh regret it, or abandon it.

The first cost is operational complexity. A mesh is a distributed system that manages your distributed system. It needs to be installed, upgraded, monitored, and debugged, and it needs someone who understands it. An upgrade to the control plane can change the behaviour of every service at once. A misconfigured policy can block traffic across the whole system. A team that adopts a mesh without anyone who owns it will find that the mesh owns them.

The second cost is performance. Two extra proxy hops add latency to every request, and the proxies consume CPU and memory on every machine. For most systems the overhead is small — a few milliseconds per request, a fraction of a core per sidecar — but it is not zero, and in a system where a request already passes through eight services, the mesh can add up to a noticeable share of the total time. Teams that measure carefully sometimes find the mesh costs more than the features are worth to them.

The third cost is debugging. When a request fails, there are now more places it could have failed: the service, the sidecar, the control plane, or the policy. A developer who used to read one log now has to read three. The mesh adds a layer of indirection to every problem, and indirection is the enemy of a quick diagnosis at 3 a.m.

The fourth cost is the learning curve. A mesh has its own concepts — virtual services, destination rules, authorisation policies — and its own configuration language, usually YAML files that run to hundreds of lines. A team that adopts one needs to learn it, and needs to keep learning it as the mesh evolves. The documentation is good, but it is long, and the gap between reading it and operating a mesh in production is wide.

None of these costs is a reason to avoid a mesh. They are reasons to adopt one for the right reasons, at the right time, with the right expectations. A team that adopts a mesh to solve a specific problem — "we need mutual TLS between services" or "we need canary releases" — usually succeeds. A team that adopts one because microservices are supposed to have one usually does not.

Sidecarless meshes and where this is heading

The newest development in the field is the sidecarless mesh, and it is a direct answer to the costs above. The idea is to move the proxy out of each service and into the operating system, using a technology called eBPF, which lets programs run safely inside the Linux kernel and intercept network traffic without a separate process per service.

Istio's ambient mesh, announced in September 2022, is the best-known example. Instead of a sidecar next to every service, it runs one proxy per node — the machine that hosts several services — and handles the traffic for all of them. Cilium, a networking project built on eBPF, takes a similar approach. The result is fewer processes, less resource usage, and simpler operations, because there is no sidecar to inject, update, or debug for each service.

The trade is that the mesh now depends on the kernel, which is a deeper and less familiar layer than a container. A bug in an eBPF program can affect the whole machine, not just one service. And the sidecarless model is newer: the tooling, the documentation, and the community knowledge are thinner than for the sidecar model, which has had a decade to mature.

For a team choosing today, the practical advice is simple. If you are adopting a mesh for the first time, look at the sidecarless options, but do not assume they are ready for everything you need. Check whether the features you care about — the traffic rules, the security policies, the observability — are supported in the sidecarless mode, because some are not yet. And if you already run a sidecar mesh, there is no rush to migrate. The sidecar model works, it is well understood, and it will be supported for years.

Do you actually need one?

This is the question that matters, and the honest answer is that most teams do not, at least not yet. A service mesh solves problems that appear at a certain scale, and below that scale it creates more problems than it solves.

You probably need one if several of these are true. You run more than about twenty services, in production, owned by more than one team. You need encrypted traffic between services, and you need it enforced rather than hoped for. You do canary releases or traffic splitting regularly, and doing it by hand is error-prone. You need to know which service is slow, and your current logging cannot tell you. And you have someone who will own the mesh — not as a side project, but as a real responsibility, with time allocated to it.

You probably do not need one if your system has fewer than ten services, or if one team owns them all, or if your services mostly talk to a database rather than to each other. A library for retries and timeouts, a shared client for service discovery, and a logging standard will get you most of the benefit at a fraction of the cost. Microservices versus a monolith is a decision that comes before the mesh decision, and many teams that are unsure about the mesh are actually unsure about the microservices, which is a cheaper question to answer first.

There is also a middle path that suits a lot of teams. Start with the pieces of a mesh you actually need. If the problem is encryption between services, a mesh is the cleanest way to get it, but so is a simpler tool that only does mutual TLS. If the problem is observability, distributed tracing can be added with a library and a collector, without a mesh at all. If the problem is traffic splitting, an ingress controller or a gateway can do it for the traffic that enters the system. Adopt the mesh when the problems pile up to the point where solving them one at a time costs more than the mesh does. That is the moment it earns its keep.

Frequently asked questions

Is a service mesh the same as Kubernetes?

No. Kubernetes is a platform for running containers: it decides where they run, restarts them when they fail, and scales them up and down. A service mesh is a layer that runs on top of Kubernetes, or on top of virtual machines, and manages how the services talk to each other. They work together — most meshes are deployed on Kubernetes — but they solve different problems. You can run Kubernetes without a mesh, and you can run a mesh without Kubernetes, though few teams do.

Does a service mesh replace an API gateway?

No. A gateway handles traffic from outside the system: users, partners, mobile apps. A mesh handles traffic between services inside the system. A request from a user passes through the gateway first, and then through the mesh as it moves between services. Most large systems have both, and they do different jobs. Confusing the two is one of the most common mistakes in this area.

How much latency does a service mesh add?

A little on each hop, usually one to three milliseconds per sidecar in a typical setup, so a request that passes through several services might pick up ten or twenty milliseconds in total. Whether that matters depends on the system. For a web request that already takes two hundred milliseconds, it is noise. For a high-frequency trading system, or a request path that crosses dozens of services, it can be a real cost. Measure it on your own traffic before deciding, because the number varies with the proxy, the configuration, and the hardware.

Which service mesh should I choose?

Istio is the most widely used and the most fully featured, and it is the default choice for teams that need the whole set of features. Linkerd is simpler, lighter, and easier to operate, and it suits teams that want the core features without the complexity. Cilium's sidecarless approach is worth evaluating if you are starting fresh and your platform supports eBPF. The differences that matter are not the feature lists, which are similar, but the operational burden and the community around each one. Talk to teams running each mesh in production, and ask them what breaks.

Can I remove a service mesh once it is running?

Yes, but it is work. The services themselves do not depend on the mesh, because the mesh sits outside the application code, so removing it means removing the sidecars and pointing the services at each other directly, or at a simpler alternative. The hard part is everything that was configured in the mesh — the traffic rules, the security policies, the observability — which has to be rebuilt somewhere else. That is why the decision to adopt one deserves more thought than the decision to try one. A trial is cheap. A migration is not.

A sane way to start

If you have read this far and you think a mesh might be right, start small and start in a place where failure is cheap. Pick one cluster, or one set of services, and install the mesh there. Turn on the observability first, because it is the feature that pays for itself fastest: the traces and metrics will show you things about your system you did not know, and they will do it without changing any traffic. Then add mutual TLS, which is the security feature most teams want, and which requires the least configuration. Then, and only then, start using the traffic features — the canaries, the retries, the circuit breakers — one at a time, with a test that proves each one works.

  • Give the mesh an owner, with real time allocated, before you install it.
  • Write down the problem you are solving, so you can tell later whether it is solved.
  • Measure latency before and after, on real traffic, not on a benchmark.
  • Keep the configuration in version control, reviewed like code, because a bad policy can take the system down as surely as a bad deploy.
  • Plan the exit. Know how you would remove the mesh if it does not work out, and make sure that plan is real, not a hope.

A service mesh is a good tool for a specific job: making the conversations between many services reliable, secure, and visible. It is a bad tool for a small system, a team without an owner, or a problem that a library could solve. The teams that are happiest with one are the teams that adopted it late, reluctantly, and for a reason they could name. If that is where you are, a mesh will serve you well. If it is not, the honest answer is to wait. The mesh will still be there when you need it.

Was this article helpful?

Muhammad Tahir

Author

 

Get new articles by email

 

Comments