blogs
About

Api Gateway Vs Load Balancer Vs Reverse Proxy

Aug 29, 2025

#85: Break Into Edge Architecture (4 Minutes)
͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­
Forwarded this email? Subscribe here for more

You are now 170,001+ subscribers strong.

Let’s try to reach 171k subscribers by 5 September.

Share this post & I'll send you some rewards for the referrals.


API Gateway vs Load Balancer vs Reverse Proxy 🌟

#85: Break Into Edge Architecture (4 Minutes)

Neo Kim
Aug 29
 
READ IN APP
 

Get my system design playbook for FREE on newsletter signup:

Upgrade to paid

This post outlines the differences between a load balancer, API gateway, and reverse proxy. You will find references at the bottom of this page if you want to go deeper.

  • Share this post & I'll send you some rewards for the referrals.

Once upon a time, a single server was enough to run an entire site.

The clients connected directly to it over the internet.

API Gateway vs Load Balancer vs Reverse Proxy

But as the internet became more popular, some sites exploded in traffic.

And it became extremely hard to scale those sites reliably.

So they added more servers and put a traffic management layer in front of those sites.

This includes components such as the load balancer, API gateway, and reverse proxy.

Yet it’s necessary to understand their differences to keep the site reliable.

Onward.


Ship faster, with context-aware AI that speaks your language - Sponsor

Augment Code is the only AI coding agent built for real engineering teams.

It understands your codebase—across 10M+ lines, 10k+ files, and every repo in your stack—so it can actually help: writing functions, fixing CI issues, triaging incidents, and reviewing PRs.
All from your IDE or terminal. No vibes. Just progress.

Learn more about Augment


Load Balancer

A load balancer distributes traffic evenly among servers.

Think of the load balancer as a restaurant manager who ensures each waitress handles a fair number of tables without overwhelming themselves.

How Load Balancer Works
How Load Balancer Works

Here’s how it works:

  1. The client sends a request to the load balancer

  2. The load balancer finds servers that are ready to accept the request

  3. It then forwards the request to the proper server

This technique ensures high availability.

Yet each service has a different workload and usage pattern. So it’s necessary to use different algorithms to route traffic.

Here are some of them:

  • Round-robin: routes traffic across servers in a sequential order.

  • Least-connections: routes traffic to the least busy servers.

  • IP-hashing: routes a client’s traffic to the same server for sticky sessions.

And some popular examples of load balancers are HAProxy, AWS ELB, and Nginx.

Besides some load balancers work at layer 4 (transport level). This means it checks the IP address and port number to route traffic. While others operate at layer 7 (application level). This means they check details such as URLs or HTTP headers to route traffic.

A load balancer prevents server overload and offers faster response time. But it adds operational costs and resource usage. Also it could become a single point of failure if configured incorrectly. So it’s important to design and monitor them for high availability.

Let’s keep going!

API Gateway

The API Gateway acts as a single entry point to the site.

Imagine an API Gateway as the kitchen window of a busy restaurant. It’s where the orders get passed from a waitress to the kitchen. This avoids overwhelming the kitchen with many orders, similar to rate limiting.

How API Gateway Works
How API Gateway Works

Here’s how it works:

  1. The client sends a request to the API Gateway

  2. The API Gateway throttles requests to avoid server overload and transforms data if necessary

  3. It then routes the request to the correct microservices based on its URL path, HTTP headers, or query parameters

  4. The API Gateway combines the responses from different microservices and responds to the client

Some popular ways to set up an API Gateway are using Kong, AWS API Gateway, and Google Cloud Apigee.

An API Gateway simplifies client interactions. Yet it slightly increases latency because of an extra network hop. Also it might become a performance bottleneck if set up incorrectly. So it’s important to install it properly.

Ready for the next part?

Reverse Proxy

A reverse proxy protects the backend server. It decrypts incoming traffic for TLS termination and caches the response to reduce server load.

Think of the reverse proxy as a kitchen host. They accept the orders on behalf of the kitchen chefs. This helps to group orders and reject orders if something is unavailable (filter traffic).

How Reverse Proxy Works
How Reverse Proxy Works

Here’s how it works:

  1. The client sends a request to the reverse proxy

  2. It forwards the request to the server

  3. The server responds to the reverse proxy

  4. The reverse proxy then caches the response and returns it to the client

Some ways to set up a reverse proxy are using Nginx, HTTP Server, or Traefik.

A reverse proxy hides the backend server complexity and speeds up responses with caching. Yet it increases operational complexity and might become a single point of failure without redundancy. So it’s important to design it with failover and set up proper monitoring.


TL;DR

Here’s how a typical edge architecture looks:

High Level Overview of Edge Architecture
High-Level Overview of Edge Architecture
  • Load balancer: distributes traffic evenly across servers

  • API gateway: handles complex service calls

  • Reverse proxy: handles security and caching

They manage traffic reliably and securely in large-scale systems. Yet this isn’t the only way to set them up together. So use them based on your scale and needs.


Subscribe to get simplified case studies delivered straight to your inbox:

Upgrade to paid

Author Neo Kim; System design case studies
👋 Find me on LinkedIn | Twitter | Threads | Instagram

Want to advertise in this newsletter? 📰

If your company wants to reach a 170K+ tech audience, advertise with me.


Thank you for supporting this newsletter.

You are now 170,001+ readers strong, very close to 171k. Let’s try to get 171k readers by 5 September. Consider sharing this post with your friends and get rewards.

Y’all are the best.

system design newsletter

Share


TL;DR 🕰️

You can find a summary of this article here. Consider a repost if you find it helpful.


References

  • What is load balancing? - Cloudflare

  • What is load balancing? - AWS

  • What is a reverse proxy? - Cloudflare

  • What is an API gateway? - Kong

  • API gateways - Azure Architecture Center

  • Horizontal scaling

  • What is observability? - OpenTelemetry

  • What is latency? - AWS

  • What is a single point of failure? - IBM

  • Block diagrams created with Eraser

Unlock access to every deep dive article by becoming a paid subscriber:

Upgrade to paid
 
Like
Comment
Restack
 

© 2025 Neo Kim
548 Market Street PMB 72296, San Francisco, CA 94104
Unsubscribe

Get the appStart writing



blogs

  • blogs
  • blogs@replies.catskull.net
  • catskull

Blogging like it's 1999.