我正在开发一个在 Windows Azure 上运行的分布式应用程序,但我对这种环境还不熟悉。我有一个关于服务器端状态管理的问题。 我应该在哪里存储全局几乎静态数据?
因为它是一个分布式环境,如果用户向应用程序发出请求,则不能保证后续请求将路由到同一服务器,因此我认为我应该使用 Sql Azure 或 Table Storage Session Provider (但是我读到存储数据可能会出现性能问题。
我还可以使用 Windows Azure AppFabric 缓存来实现 session 维护。
存储不需要保护的全局信息的更好解决方案是什么?有没有类似“Application”的东西(比如Application[“key”] = value)?
谢谢
最佳答案
请查看我在以下主题中的回复:
Microsoft Azure .NET 4.5 WebForms App : Session TimeOut / InProc / Single Instance
具体如下:
If you want to maintain session state you have to use one of the following options
- SQL Session State Provider using Azure SQL
- Azure Table Session State
- Session State with Azure Redis Cache
You can find details on how to do this at the following links:
- Session State Management in Windows Azure Web Roles
- Session state with Azure Redis cache in Azure App Service
The easiest way in my opinion is using Azure Redis Cache as noted in the link above.
Let me know if this helps!
关于azure - Windows Azure 中的服务器端状态管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34207172/