简体   繁体   English

扩展ASP.NET数据缓存以在Web场之间共享

[英]Extending ASP.NET data cache to be shared across web farm

I have an ASP.NET application that makes extensive use of ASP.NET cache API for caching commonly-used data. 我有一个ASP.NET应用程序,它广泛使用ASP.NET缓存API来缓存常用数据。 In addition, I am using polling-based sql cache dependency to track expiration. 另外,我使用基于轮询的sql缓存依赖来跟踪到期。

The drawback of the current design is that, in the web farm environment, each web server has its own data cache that is not shared across servers. 当前设计的缺点是,在Web场环境中,每个Web服务器都有自己的数据缓存,而不是跨服务器共享。

Is there a way I can simply migrate the code to share data cache across multiple servers? 有没有办法可以简单地迁移代码以跨多个服务器共享数据缓存?

I've thought of using memcached however that would not work with sql cache dependency, right? 我曾经想过使用memcached,但这不适用于sql cache依赖,对吗?

Any other solutions? 还有其他方法吗?

Have you looked at Windows Server AppFabric (Formerly Velocity). 你看过Windows Server AppFabric(以前的Velocity)吗?

http://blogs.msdn.com/velocity/ http://blogs.msdn.com/velocity/

You could use following options - 您可以使用以下选项 -

  1. Use the approach described here for synchronizing the data across web farms - http://www.eggheadcafe.com/articles/20030420.asp 使用此处描述的方法在Web场中同步数据 - http://www.eggheadcafe.com/articles/20030420.asp

  2. Use distributed caching approach 使用分布式缓存方法

  3. Use enterprise library cache. 使用企业库缓存。

It seems to me that Windows Server AppFabric is exactly what you are looking for. 在我看来, Windows Server AppFabric正是您正在寻找的。 (AKA "Velocity"). (AKA“Velocity”)。 From the introductory documentation : 介绍性文件

Windows Server AppFabric provides a distributed in-memory application cache platform for developing scalable, available, and high-performance applications. Windows Server AppFabric提供分布式内存中应用程序缓存平台,用于开发可伸缩,可用和高性能的应用程序。 AppFabric fuses memory across multiple computers to give a single unified cache view to applications. AppFabric将内存融合到多台计算机上,为应用程序提供单一的统一缓存视图。 Applications can store any serializable CLR object without worrying about where the object gets stored. 应用程序可以存储任何可序列化的CLR对象,而无需担心对象的存储位置。 Scalability can be achieved by simply adding more computers on demand. 只需按需添加更多计算机即可实现可扩展性。 The cache also allows for copies of data to be stored across the cluster, thus protecting data against failures. 缓存还允许跨群集存储数据副本,从而保护数据免受故障的影响。 It runs as a service accessed over the network. 它作为通过网络访问的服务运行。 In addition, Windows Server AppFabric provides seamless integration with ASP.NET that enables ASP.NET session objects to be stored in the distributed cache without having to write to databases. 此外,Windows Server AppFabric提供与ASP.NET的无缝集成,使ASP.NET会话对象能够存储在分布式缓存中,而无需写入数据库。 This increases both the performance and scalability of ASP.NET applications. 这样可以提高ASP.NET应用程序的性能和可伸缩性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM