Three diagrams, three architectures, one front door. The clearest way to understand why teams move from a single server to microservices behind an API gateway.

Three boxes. Ten boxes. One front door.
That's the entire monolith → microservices → API gateway journey, drawn small. Most posts pad it with two thousand words of definitions before showing you a single picture. Here are the three pictures. Then the words.
The system most engineers ship first.
+-------------------+
| Client (browser, |
| mobile, partner) |
+---------+---------+
|
| 1 HTTP request
v
+-------------------+
| Monolith server |
| |
| auth users |
| posts billing |
| email search |
+---------+---------+
|
| 1 in-process call -> 1 SQL query
v
+-------------------+
| One database |
+-------------------+
In code: one repository, one deploy artifact, one database connection pool. A user clicks "Save profile". The browser makes one request. The server handles auth, validates the body, calls usersRepository.update(...), fires a single UPDATE, returns. Total network hops outside the box: one.
What this buys you:
What breaks first as you scale:
This is roughly the 150-engineer wall. Below that, monoliths win on speed and clarity. The companies that split too early regret it; the ones that split too late regret it just as much.
The reaction to those pain points.
+-------------------+
| Client |
+--+--------+----+--+
| | |
v v v
+------+ +------+ +------+
| Auth | | Users | | Posts | ... + Email, Billing, Search
+--+---+ +--+---+ +--+----+
| | |
v v v
+----+ +----+ +----+
| DB | | DB | | DB |
+----+ +----+ +----+
Each feature is now its own process, with its own database, deployed on its own schedule. The client knows about all of them.
What changed structurally:
posts needs the user's display name, it can no longer import { getUser } — it has to make an HTTP (or gRPC) call to users.auth is up 99.9% of the time and users is up 99.9%, your /profile endpoint that calls both is up 99.8%. With six services in the chain, you're at 99.4% — a ten-times-worse error budget.What this buys you:
email doesn't take down checkout.But look at the picture: the client has to know every service exists. The browser is calling N hostnames. Auth tokens have to be re-presented to each. CORS has to be configured for each. When one service moves, every client breaks. This is the problem the API gateway exists to solve.
+-------------------+
| Client |
+---------+---------+
|
| 1 HTTPS request to one URL
v
+-------------------+
| API gateway |
| |
| auth check |
| rate limit |
| routing |
| retries |
| response shaping |
+--+----+-----+-----+
| | |
v v v
+------+ +------+ +------+
| Auth | | Users | | Posts | ... + Email, Billing, Search
+--+---+ +--+---+ +--+----+
| | |
v v v
+----+ +----+ +----+
| DB | | DB | | DB |
+----+ +----+ +----+
The gateway sits in front of every microservice. From the client's view, the system looks like a monolith again — one URL, one auth, one error format. Behind the gateway, you can have ten or a hundred services.
What it does, concretely:
POST /api/posts goes to posts-service; GET /api/users/:id goes to users-service. The client doesn't know either of those addresses.users is degraded, fail fast at the gateway instead of letting requests pile up.The cost: the gateway is a new piece of infrastructure to operate, and it can become a bottleneck (or a single point of failure) if you don't run it carefully. Most teams pick a managed gateway (AWS API Gateway, GCP API Gateway, Azure API Management) or a battle-tested OSS one (Kong, Apache APISIX, Traefik, Envoy). Microsoft has a thorough write-up of the trade-offs if you want to go deeper.
The mental model that sticks: the API gateway is what makes your microservices look like a monolith from the outside. That's not an accident — that's the entire point.
A short decision flow:
Are you a team of fewer than 20 engineers, on a single product? Stay on the monolith. You'll iterate faster and pay none of the operational tax.
Are you painfully blocked on deploys, scaling, or team boundaries? Extract one service first. A common starting point: pull out the slowest or most-rate-limited feature (search, image processing, email sending). Run it alongside the monolith. Don't build a microservices platform — build one service.
Do you already have three or more independent services? Add the API gateway now, not later. Every month you wait, more clients accumulate hard-coded URLs, duplicate auth code, and inconsistent retry behaviour. Migrating off direct-to-service routing later is twice the work.
Are you adding microservices because everyone else is? Don't. The architecture serves the team and the product, not the other way around.
A monolith is one box. Microservices are many boxes. The API gateway is the front door that hides how many boxes there are.
Each architectural step is a forced trade — you give up something (function calls, transactions, atomic deploys) for something else (independent scaling, smaller blast radii, team autonomy). The gateway is what makes the trade survivable for clients. Without it, "microservices" really means your client must now do the orchestration, which is almost always worse than the monolith you replaced.
Three boxes. Ten boxes. One front door. That's the whole picture.
Sign in to comment.
No comments yet. Be the first.

Frontier benchmarks have converged. The price spread is 178×. The best AI model isn't a thing — the best for each job is. Here's the 2026 stack.

Three models, three prices, twenty-fold savings if you cache and batch. The reference I send new hires when they ask 'what should I know about Claude?'