Load Balancer vs API Gateway
System Design

Load Balancer vs API Gateway

Subtitle: Traffic distribution vs traffic control

Left column - Load Balancer:

Spreads requests across identical servers Works at L4 (TCP) or L7 (HTTP) Health-checks backends, removes dead nodes Cares about capacity, not meaning Think: keep the fleet evenly busy

Right column - API Gateway:

Single front door for many services Auth, rate limits, routing, versioning Transforms and aggregates requests Cares about meaning, not just capacity Think: one policed entrance for all APIs

Simple difference:

Load Balancer = which server handles this API Gateway = should this request happen at all

Use it when - Load Balancer: many identical instances, need failover, want low latency spread Use it when - API Gateway: many microservices, need auth and quotas, want one public contract

Sticky note - Common beginner mistake:

Putting business logic in the load balancer. Keep it dumb and fast; policy belongs at the gateway.