Node + Redis session store
Compare sticky sessions vs Redis-backed sessions for a Node app behind a load balancer.
Answers use simple, clear English.
Quick interview answer
Sticky sessions pin a client to one instance — simple but uneven load and bad on rolling deploys. Redis (or DB) session store lets any instance serve the user; set TTL, secure cookies, rotate session id on login. Prefer JWT/stateless for APIs; server sessions for classic web apps needing revocation.
Detailed answer
Sticky sessions pin a client to one instance — simple but uneven load and bad on rolling deploys. Redis (or DB) session store lets any instance serve the user; set TTL, secure cookies, rotate session id on login. Prefer JWT/stateless for APIs; server sessions for classic web apps needing revocation.
Real example & use case
connect-redis store; cookie httpOnly Secure SameSite; TTL 1 day.
Pros & cons
Pros of Redis: horizontal scale. Cons: Redis dependency/latency.