Home/Labs/Client-Server Scaling Lab
All 280 Labs
INTERACTIVE LAB🔀

Client-Server Model Lab (Interactive)

Round-robin interactions across replicas and watch stateful sessions break horizontal scaling. Compare thin vs thick clients and stateful vs stateless servers by routing live requests through a replica fleet.

Client-Server Split & Stateless Scaling Lab

Route user interactions across replicas and watch stateful servers break horizontal scaling.

App Server #1
0 req
App Server #2HOLDS SESSION
0 req
App Server #3
0 req
App Server #4
0 req

No interactions yet. Send a request to see how the load balancer routes it.

Failed requests
0/0 (0%)
Server round-trips
0
Bytes over wire
0.0 KB
Client model
0.9 KB JSON / click
The session lives only in replica #1 memory. The load balancer round-robins, so every request on another replica returns 401 until you add sticky sessions — which creates hotspots and breaks failover. Move sessions to Redis and every replica can serve every request.

How It Works Under the Hood

The client-server model partitions work: clients own presentation, servers own truth — authentication, business rules, and transactions. The golden scaling rule is that app servers must hold zero per-user state; when sessions live in local memory, a load balancer round-robining across replicas randomly loses the session and returns 401, forcing sticky sessions that create hotspots and break failover. Moving state to Redis or JWTs lets any replica serve any request. Thin clients ship full HTML per interaction; thick clients ship small JSON, shifting compute to the device.

Core Architectural Principles

  • Stateless servers + load balancer = any replica can serve any request; stateful pins sessions to one replica.
  • Thin client costs ~48 KB server-rendered HTML per click; thick client costs ~0.9 KB JSON.
  • Client-side validation is UX only — the server must re-verify every rule for security.
Interview Round Script

When proposing an app tier, say servers are stateless with sessions delegated to Redis so replicas scale without sticky sessions. Mention that thick-client SPAs reduce server CPU and bandwidth per interaction, and that the server is the only security boundary — a point interviewers listen for when probing backend-for-frontend decisions.

Key Trade-Offs

Centralized control and independent scaling vs a server-side single point of failure and per-interaction network latency.

Related Curriculum Chapter

Client-Server Model Basics

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs