I'm developing a web application for Windows Azure using ASP.NET MVC 4. I would like to enforce one restriction in the architecture: do not use Session.

To achieve availability on Azure, and since there is no sticky sessions, I would need to store the session data in some central service, probably either SQL Azure or the Caching Service.

I would rather avoid sessions on the SQL database to avoid the increased latency, and the caching service on Azure is very expensive for the ammount of memory offered.

On the other hand, I would like to have the ability to easily pass Flash-style messages among redirects. TempData is the recommended way to do this, but by default it uses the session object.

So I would like to know:

  1. Is there an alternative way to use TempData that doesn't require sessions or shared data between servers? Cookies perhaps?
  2. Is there a better alternative I'm overlooking?
  • You should ask this question on StackOverflow. You'll get answers from some expert MVC & Azure people.
    – BZink
    Jun 6, 2012 at 20:00
  • I suppose you are right. I asked here because it's related to architecture. In fact it's a very subjective line between "conceptual questions about software development" and "programming Q & A". Thanks! Jun 7, 2012 at 12:04

1 Answer 1


I worked with Azure for almost 2 years, I had dreams of building my own caching service using an Azure worker role and something like memcached. I never got around to it but it still sounds like fun, and I think it would meet your needs.

Steve Marx (former azure evangelist) wrote about it on his blog a while back...


  • Thank you. I agree, running memcached either in a worker role or even in the web roles themselves might be a cheaper alternative to the caching service. The tradeoff is some additional work. Heck, we could even run it in Linux now that Azure can host durable Linux instances. Jun 7, 2012 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.