Skip to main content

Sticky Session

What sticky session means in load balancing, why it simplifies some flows, and why it also creates coupling that gets expensive later.

Andrews Ribeiro

Andrews Ribeiro

Founder & Engineer

What it is

A sticky session means the load balancer tries to send the same user back to the same instance repeatedly.

In practice, it “sticks” that session to one server for a while.

When it matters

This usually shows up when part of the state still lives in application memory:

  • user session
  • shopping cart
  • multi-step flow

It is a quick way to make things work before externalizing that state.

Common mistake

The classic mistake is treating sticky session as an architectural solution when it is often just a temporary crutch.

If the instance dies, that local state is gone.

And if traffic gets uneven, some instances run much hotter than others.

Short example

A Node app stores session state in local memory.

With sticky sessions, the user keeps landing on the same instance and everything seems fine.

Without it, each request could hit a different server and “lose” the session.

Why it helps

Sticky session can simplify an early stage.

But it creates dependency on local state and often gets in the way of:

  • failover
  • autoscaling
  • balanced traffic distribution

Sticky session fixes the symptom quickly. Externalizing state fixes the cause.

You finished this article

Keep exploring

Related articles