Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. In addition, I am using polling-based sql cache dependency to track expiration.

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.

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?

Any other solutions?

like image 537
frankadelic Avatar asked Oct 29 '09 16:10

frankadelic


People also ask

What is distributed caching in asp net?

A distributed cache is a cache shared by multiple app servers, typically maintained as an external service to the app servers that access it. A distributed cache can improve the performance and scalability of an ASP.NET Core app, especially when the app is hosted by a cloud service or a server farm.

How will you create the caching in asp net?

To manually cache application data, you can use the MemoryCache class in ASP.NET. ASP.NET also supports output caching, which stores the generated output of pages, controls, and HTTP responses in memory. You can configure output caching declaratively in an ASP.NET Web page or by using settings in the Web. config file.

How many types of cache dependencies are available in ASP NET?

In this article ASP.NET 1. x offered three different options for caching; output caching, fragment caching, and the cache API.

Is Redis distributed cache?

Redis is an open-source in-memory data structure project implementing a distributed caching, in-memory key-value database. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, hyper log, bitmaps, streams, and spatial indexes.


2 Answers

Have you looked at Windows Server AppFabric (Formerly Velocity).

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

like image 73
Plip Avatar answered Sep 21 '22 13:09

Plip


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

  2. Use distributed caching approach

  3. Use enterprise library cache.

like image 21
Prashant Avatar answered Sep 19 '22 13:09

Prashant