Node.js
/Advanced
Load Balancing
Definition
The process of distributing network traffic efficiently across multiple servers. It ensures no single server bears too much demand.
Explain Like I'm New
The traffic cop. If you scaled horizontally and have 5 Node.js servers, the Load Balancer sits in front of them. When 100 users visit your site, the Load Balancer directs 20 to Server A, 20 to Server B, etc. If Server C catches fire and crashes, the Load Balancer detects it instantly and redirects all traffic to the healthy servers, meaning the users never even notice the crash.
Real World Example
AWS Application Load Balancer (ALB) or NGINX. The DNS points `google.com` to the Load Balancer, which then silently forwards the traffic to Google's millions of internal servers.
Common Use Cases
- •Distributing high traffic
- •Ensuring High Availability / Fault Tolerance
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- Does the client communicate directly with the individual Node.js servers?
intermediate
- What is 'Round Robin'?