Neo
Neo

Reputation: 81

Sticky sessions with Load Balancer

It would be a great help if you can clarify on this please.

When am using a load balancer and I bind a server with a client with say either appsession or any other means. However if that server goes down then the load balancer redirects the client to another server and while doing so, the whole session is lost. So do i have to write my application in such a way that it stores session data externally so that it can be shared?

So how good is using a load balancer when a transaction fails halfway because the server goes unresponsive?

Please let me know, thanks.

Upvotes: 0

Views: 2869

Answers (1)

duyvh
duyvh

Reputation: 494

There is a difference between the 2 concepts: session stickiness and session replication.

  • Session stickiness gives you an assurance that once a request from a client reaches a healthy server, subsequent requests from the same client will be handled by that server. When your server goes down, the stickiness is lost, and new requests go to a different healthy server. Session stickiness is usually offered by the load balancer and your application servers generally do not need to do anything.
  • Session replication gives you the capability of recovering the session when a server goes down. In the above case, stickiness is lost, but the new server will be able to recover the previous session based on an external session storage, which you will have to implement.

Upvotes: 4

Related Questions