Stateless Servers + External Store Versus Stateful Servers With Sticky Sessions
TradeoffMidSeniorUpdated
Designing a fleet of API servers that need to scale horizontally based on traffic.
Short answer: Stateless servers + external store. Stateless servers scale and recover trivially: any instance handles any request, autoscaling is straightforward, rolling deploys are safe.
The Two Options
A
Stateless servers + external store
B
Stateful servers with sticky sessions
Drill This: Your Pick First
The Better Pick
Option A
Stateless servers + external store
Stateless servers scale and recover trivially: any instance handles any request, autoscaling is straightforward, rolling deploys are safe.
When the Other One Wins
Stateful servers with sticky sessions
Real-time apps (game servers, video conferencing) where state is heavy and latency matters often pin clients to a stateful node.