Out of process caching
I have a .NET website which queries the DB using Entity Framework every 3 seconds for the status of the transaction using AJAX and updates the page. This status is set by an external client using a RESTful webservice hosted on another server.
I want to avoid hitting the DB every 3 seconds for each transaction so want this information cached in memory. The REST webservice updates the cache and website开发者_开发问答 reads from it. Is there any FOSS or commercial Out of Process Shared Cache library that I can use to speed up the performance?
You can consider using Windows Server AppFabric.
- Intro here http://msdn.microsoft.com/library/cc645013.aspx
Windows Server AppFabric provides a distributed in-memory application cache platform for developing scalable, available, and high-performance applications. AppFabric fuses memory across multiple computers to give a single unified cache view to applications. Applications can store any serializable CLR object without worrying about where the object gets stored. 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. This increases both the performance and scalability of ASP.NET applications.
memcached is one of the more popular ones.
Another option is Coherence. Java-based but runs on Windows, and has a .NET client.
You can use the .net remoting channels in named pipe mode. If caching datatables or datasets you would have to implement your own serialization for better performace.
精彩评论