I am currently developing a new website built on MVC and I am wondering how to properly manage the state. The state should contain userId and some structures of user information and should be stored during the entire user session during login (via HTTP requests).
Important criteria:
1) Support for scalability
2) Performance
An easy way is to use a Session object, but it does not support scalability. If different requests during a session pass through different IIS servers, the session will not be saved. Although I have heard of load balancing tools that route all requests from a single session through the same computer, I'm not sure it's good practice to rely on it (isn't it?)
Another option I read is storing state data on special state servers running RAM DB (for example, Cassandra for Linux or Redis for Windows). But it seems to me that at this stage of development this is an overflow.
Do you have any other suggestions? I would like to start with something simple at the moment, but in the future prepare the project for a more advanced solution.
Any best practices or suggestions for code / design development will be appreciated.
Thanks
Eddie.
source
share