0

I have a web application written in asp.net mvc2. Currently hosted on amazon cloud ec2. Because of growing traffic we want move multi instance enviorenment. I have a custom session class which currently initiate at session start (global asax) and i am using via getter or setter class in application. Because of multi instance chore i have to handle hole security architecture. I am looking a better way to handle this problem.

I am looking for good implementation of session and how to apply on amazon ec2 multi instance environment. What is road blocks for system architecture?

gandil
  • 104
  • 2
  • 10

1 Answers1

1

We have our web app running on EC2, but its a basic ASP.NET App, not MVC. We got around the session state issue by pointing both of our servers to to a SQL box, which they where going to talk to anyway, and used that for Session State. Another option is to use something like Memcached or Membase as your session state, and share the state across multiple machines that way.

The only obstacle i can think of is around naming of machines. Each instance will change when they reboot, so what you would need to do is something as follows:

  • setup a master memcache or membase server. this should set a DNS record for itself on boot.
  • on machine start, get the current instance ip address, and register it with either memcached or membase (membase i think is easier for this).
  • on shut down, disconnect from the master server.

there is a Memcached Session State and Cache Provider on CodePlex which should easily help you do what you need to do.

Again, the way we got around it was SQL server... This was easier for us to setup, but i am not ruling out a memcache/membase option any time soon either...

TiernanO
  • 744
  • 7
  • 17