We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
2 system design questions lean on this idea. Each walks through the full answer.
System Design Masterclass · Load Balancing Proxies
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Load Balancing Proxies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
There is no gateway-specific theory to learn. An API gateway is where every mechanism in this chapter ends up living once there is more than one service.

What is new is not any single feature. It is that all of them are in one place, owned by one team, on one deployment schedule, on the critical path of everything.

The stages are ordinary and individually cheap. What makes them consequential is that there is no way to opt one service out.

That simplification is the product. It is also the dependency that makes the service unable to run without the gateway.
Notice what has happened to the service's security model. It now trusts a header it did not verify, because the gateway verified it, and that is only true while the gateway is the only way in.

Five real features, including verifying an HMAC and validating a body against a schema, added nineteen microseconds in total.

Going through the gateway at all costs 0.160 milliseconds and does nothing. Adding five real features on top of that costs 0.019.
Which reframes the usual argument. People debate whether to enable a gateway feature because of its cost, and the features are nearly free. The decision that costs something is whether there is a gateway in the path at all, and that one is usually made once and never revisited.
The larger cost is not .

Nothing here is simulated. It is one multiplication and a subtraction, and it is the part of "we will put a gateway in front" that nobody works out first.

At 99.5 percent the gateway adds 2,627 minutes, at which point the service's own availability has stopped being the thing that decides anything.

The second block of the capture is the argument for a gateway: independent outages grow with the fleet and the gateway's own do not. What you get instead is fewer, larger, correlated incidents.
Those are the same minutes and a completely different day. Which one an organisation would rather have is a real question with no arithmetic answer, and it is worth asking out loud.