What is a Service Mesh?
A service mesh, told as a story about the dedicated path rides use to talk to each other.
Rides talk to each other in different ways, and it all tangles.Each ride asks about stock or wait times in its own way.
With more rides, the wires tangle into a hairball.Each new ride adds far more connections than just one.
Attach the same small connector behind each ride, and the connectors talk to each other.The rides themselves don't need to worry about it.
Each ride talks only to its own connector — the connectors talk to each other.This web of connectors is the service mesh itself.
Adding connectors is more work too — with just a few rides, skip it.Sidecars add up too. Use them only when you actually need them.
A service mesh = instead of rides talking directly, each one gets an identical sidecar connector that talks to the others in a shared language.
A service mesh is an infrastructure layer that handles communication between microservices outside the application code. A sidecar proxy next to each service takes over traffic control, mTLS, retries, and observability.
When grown-ups say it
- Service mesh
- The web of dedicated paths between rides. The connectors solve the problem of rides not speaking the same language.
- Sidecar
- The identical connector box attached behind each ride. One per ride, and they all look the same.
- mTLS
- A code only the connectors know. No one can sneak in pretending to be a connector.
- Traffic control
- Deciding which path gets how much traffic. The connector handles it instead of the ride.
- Retry policy
- The rule for waiting a bit and trying again. The connector means each ride doesn't need its own rule.
- Observability
- Logging who talked to whom. Everything the connectors say to each other gets logged. → the four gauges on the wall
- Circuit breaker
- A switch that stops sending traffic to a side that keeps failing. The connector takes care of this too.
- API gateway
- The booth between guests and rides. The gateway sits between guests and rides; the mesh sits between rides themselves. → the front gate booth