Azure 中的 ASP.NET 会话状态提供程序
据我所知,目前的情况是这样的:
- 使用 SQL 会话状态提供程序是可能的(正如我在某处读到的),但 Microsoft 不支持它。所以它将来可能会停止工作。它还需要一个 WorkerRole 来删除过时的数据。
- Azure AppFabric 缓存服务仍处于 CTP 中。
- TableStorageSessionProvider 是 Azure 培训工具包中的一段代码,不建议用于生产代码。
你会选择什么?
As far as I know, the current situation is this:
- Use SQL session state provider is possible (as I've read somewhere) but it's not supported by Microsoft. So it could stop working in the future. Also it needs a WorkerRole to delete the outdated data.
- Azure AppFabric Caching Service is still in CTP.
- TableStorageSessionProvider is a piece of code in the Azure training kit that is not recommended for production code.
What would you choose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您本周上线,我会推荐 SQL Azure 会话状态提供程序。 这里有一篇出色的博客文章,提供了所有内容您需要。您是对的,Azure 并未正式支持此解决方案。不过,目前它应该可以正常工作,并且一旦上线,您可以轻松地转向 Azure AppFabric 缓存(如 Igor 的建议)。**编辑 2014 年 6 月 16 日 ** 请参阅 Azure Redis 缓存(预览版) ) 15 分钟内使用 Azure Redis 缓存的 MVC 电影应用程序
编辑 2012 年 5 月 23 日 自此回答以来发生了很多变化。自 2011 年 8 月起,SQL Azure 中的缓存通过通用提供程序得到正式支持。有关更多信息,请参阅此博客邮政。 100MB 数据库的起价为 4.99 美元。
AppFabric 缓存于 2011 年 5 月上线。缓存起价 128MB,售价 45 美元。 AppFabric 缓存的详细信息位于此处。请注意,交易数量、连接数量和带宽(以及存储容量)存在每小时配额。
编辑 2012 年 6 月 7 日 另一项更新:在 2012 年春季版本中,现在还可以使用现有 Web 或 Worker 角色中一定比例的 RAM 创建缓存(无需任何成本)作为新的缓存角色,在您的部署中创建专用高速缓存(用于实例成本)。 Scott Guthrie 在此处发表了相关博客< /a>.新的 v1.7 SDK 中提供了这些功能。
If you're going live this week, I'd recommend the SQL Azure session state provider. There's an excellent blog post here that provides everything you'll need.You're correct in that this solution isn't officially supported by Azure. However, it should work fine for now, and you can very easily shift to Azure AppFabric Caching (as suggested by Igor) once that goes live.**EDIT 6/16/2014 ** See Azure Redis Cache (Preview) ASP.NET Session State Provider section of MVC movie app with Azure Redis Cache in 15 minutes
EDIT 5/23/2012 Lots of changes since this answer. As of August 2011, cache in SQL Azure is officially supported, via Universal Providers. See more info on this blog post. Pricing starts at $4.99 for a 100MB database.
AppFabric Cache is live as of May, 2011. Cache starts at 128MB for $45. Details of the AppFabric Cache are here. Note that there are hourly quotas in place on number of transactions, number of connections, and bandwidth (as well as storage capacity).
EDIT 6/7/2012 Yet another update: With the Spring 2012 release, there's now the ability to create a cache using a percentage of RAM in your existing Web or Worker roles (costing nothing), as well as a new Cache Role to create dedicated high-speed cache within your deployment (for the cost of the instances). Scott Guthrie blogged about it here. These features are available in the new v1.7 SDK.
恕我直言:Azure AppFabric 缓存服务。从战略上讲,这是他们要去的地方,他们很可能会在你完成开发之前完成它。
IMHO: Azure AppFabric Caching Service. It's strategically where they're going and they'll likely be done with it before you finish development.
正如我在上面的评论中提到的,AppFabric 缓存现已投入生产。详细信息(包括定价和 SLA)位于此处。产品版本的亮点:
通过门户,创建缓存命名空间后,只需单击生成 web.config 的按钮/app.config 您复制粘贴的片段。就是这么简单。
As I mentioned in a comment above, the AppFabric Cache is now live, in production. Details, including pricing and SLA, are here. Highlights of the production release:
Through the portal, once you create your cache namespace, you simply click a button that generates web.config/app.config snippets that you copy 'n' paste. It's that simple.