1

I am trying to understand and figure out how can sticky sessions be avoided in general.

I researched to come across a lot about, Sticky and NON-Sticky sessions and Pros and Cons of Sticky Session / Session Affinity load blancing strategy? And how sticky sessions are to be avoided at all costs but none of these resources and questions really mentioned an alternative strategy to sticky sessions or how else to maintain user state.

Some ideas that come to mind are a central DB of sorts to keep track of sessions but that seems to be bad design too.

synergy
  • 11
  • 4

1 Answers1

0

You can actually go with a combination of a distributed cache (Redis) and central DB as well. Read from Cache and DB eventually for consistency, while write all your cached data into DB at regular intervals.

The Cache and DB datastructure should have expiration time as well and you can reset the time everytime an action happens. This is an approach if you want to avoid Sticky sessions. Sticky Sessions do not fail more often, shows inconsistency if loadbalancing is based on IP Address config.

Santosh
  • 19
  • 2