Understanding Load Balancing and Gateway Architecture Through a Story
The article explains, using a startup scenario, how a single‑server setup leads to performance bottlenecks and single‑point failures, prompting the adoption of load balancing with Nginx and an additional gateway layer for authentication, security, and traffic control, while also containing promotional material for development tools.
Hello everyone, welcome to the Top Architecture Tech Stack; today we will discuss what load balancing is through a story.
Li Daniu started a business; initially there was little traffic, so he deployed a single Tomcat server and had clients send requests directly to it.
At first this worked because the load was low, but as the business grew rapidly the single machine became a performance bottleneck and a single point of failure; when it went down, the service stopped entirely. To avoid these issues, Li Daniu added two more servers (three in total) so that clients could be directed to any of them, ensuring that if one failed the others would continue serving traffic.
However, letting clients choose a server directly is problematic because they must know the server list and cannot detect failures in advance. The solution is to introduce a Load Balancer (LB) layer that receives all client requests and forwards them to a healthy server, commonly implemented with Nginx.
While this architecture supports rapid growth, Li Daniu realized that all traffic reaching the servers directly could be unsafe. He therefore added a gateway layer, also deployed as a cluster to avoid single points of failure, to perform authentication before forwarding requests to the servers.
The gateway not only authenticates requests but also provides risk control, protocol conversion (e.g., HTTP to Dubbo), and traffic shaping, ensuring that only safe and controllable traffic reaches the backend services.
--- END ---
Promotional note: The author also recommends using a licensed JetBrains IDE (such as IDEA, PyCharm, WebStorm, GoLand, PhpStorm) to boost development efficiency, offering activation via personal accounts and supporting all paid plugins and themes.
Top Architecture Tech Stack
Sharing Java and Python tech insights, with occasional practical development tool tips.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.