Web / NGINX Interview questions
Why do we use upstream blocks with multiple servers?
Listing multiple servers in an upstream block turns a single point of failure into a pool that NGINX can spread load across and route around problems in.
With only one backend server, any restart, deploy, or crash takes the whole service down for every user. With several servers in the pool, NGINX can mark a failing one as unavailable and continue sending traffic to the healthy ones, so a single backend failure doesn't become an outage.
It also enables horizontal scaling: as traffic grows, you add more servers to the upstream block rather than trying to make one server handle everything, and rolling deploys become possible by taking servers out of rotation one at a time.
More Related questions...