Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which second level cache to select for nHibernate?

I have a Data Service created using WCF that internally uses nHibernate. This WCF Data Service is consumed by an Asp.Net application deployed on Web Server using Tcp Channel.

To improve the performance of the nHibernate Data service I want to implement nHibernate second level cache. Which second level cache provider will be good in this scenerio? As the SysCache uses Asp.net caching probably I can't use it inside WCF Service?

The above WCF Data Service can have multiple instance on different servers to improve the scalability of the application.

like image 937
Amitabh Avatar asked Mar 02 '10 16:03

Amitabh


1 Answers

ASP.NET's cache does work outside of ASP.NET, and therefore also SysCache and SysCache2.

However, since you're going to distribute your service over several servers you'd be better off with an out-of-process cache, like memcached, Velocity or SharedCache (all of these have corresponding NHibernate.Cache implementations)

like image 151
Mauricio Scheffer Avatar answered Sep 26 '22 13:09

Mauricio Scheffer