Skip to content
HLD Learn/Microservices & Service Architecture

API Gateways in a Microservices World

4 min read

You'll learn to

  • -Explain the gateway's role once you have many services

The Protecting Your System module introduced the API Gateway as a good idea even for a single service. In a microservices world, it goes from "good idea" to close to mandatory: dozens of independently-deployed services can't each reimplement authentication, rate limiting, and TLS termination without massive duplicated effort and inconsistency.

Backend for Frontend (BFF)

Some architectures go a step further and run multiple gateways, each tailored to one type of client: a mobile BFF that aggregates and trims responses for a bandwidth-constrained app, and a separate web BFF shaped around what the browser client needs. Same backend services underneath, different front doors for different consumers.

Mobile App
Web App
Mobile BFF
Web BFF
Users Service
Orders Service

Each BFF aggregates the same backend services into a shape tailored to its specific client.

Interview Signal

Your mobile app screen needs data from four different microservices. Should the mobile client call all four directly?

Weak Answer

"Sure, the client can just make four API calls."

Strong Answer

"That couples the mobile client to internal service boundaries that have nothing to do with it, and turns one screen load into four round trips (worse on a mobile network) with four separate failure modes to handle client-side. A BFF aggregates those four calls server-side (one request from the client, one response shaped exactly for that screen) and internal services can be re-split or renamed later without ever touching the mobile app."

Check Yourself1 / 3

Which of these is a genuine signal to split a monolith?

Ready to Build This?

Level 18: Ride-Sharing (Uber) is a full microservices exercise.

ScaleDojo Logo
Initializing ScaleDojo