Performance Engineering: Caching sessions, common pitfalls, effects on performance, and Scalability limitations.
Have always been dealing with sessions and accept cookies to handle session. Let's uncover it and understand it's performance impact.
What is an HTTP session ?
HTTP is stateless protocol. Right.
So , Question 1: how could we maintain information regarding user session ?
Before we answer this, Why do we even need to have session created and it's information persist ??
You open amazon or any eCommerce website , what you usually do:
Once a user connects to your application a session is created.
Session is a technique to retain state over a stateless nature of HTTP protocol.
Example of HTTP session details from chrome:
HTTP session details can be viewed via chrome(your browser), for chrome follow these steps:
领英推荐
How is session details handled on server side
This session id is sent along with request to the server which is used to extract and respond with session specific data.
Based on user base , there could be millions of active session at a time. To handle and store the session various ways are:
Session caching anti-pattern
It's very tempting to store and cache every user related details. This leads to misuse and bloating of session storage and caches with unnecessary data too.
Few of the session caching anti-patterns are:
Performance impact:
Session caching is technique to boost performance and user management but above anit-patterns or more leads to performance degradation:
More user traffic can be handled with effective session handling and caching implementation.
Next step:
Perform activity with low and high session storage.