NCache 4.4 - Online Documentation

Local Cache

 
NCache supports a standalone, non-clustered cache which resides on a single node. Local cache is similar in features with other clustered caches, i.e., it has all the caching features provided in any other caching topology, but it is not scalable or fault tolerant like clustered caches. As it is a single server cache, so its transactional capacity can’t be increased by adding multiple servers. Also, it creates a single cache instance (no backup or replica) thus if it goes down, all cached data is lost. Local cache is suitable for applications having a small number of clients with low activity or where applications don't need to cache large amount of data.
 
Isolation Levels
 
A local cache has the following two isolation levels.
 
  • InProc
This  isolation level means that cache resides inside the memory space of client application. As this type of cache exists inside the application process, so the response time is faster. In InProc, NCache keeps cached data as live objects (not in serialized form) which reduces the serialization/de-serialization cost. However, memory limitations can be faced since application and cache share the same memory. Also cached data in this case can’t be shared with applications running outside this process.
 
  • OutProc
This isolation level means that cache resides in a separate process (NCache service process) than client application. Multiple clients (local and remote) can connect to the same cache to share data. Latency in this case is more than InProc cache because of communication cost outside the process.
 
OutProc local cache is suitable for situations when multiple clients application needs to access the same cached data. For example, in a web garden where each ASP.NET application runs in a separate worker process, OutProc cache should be used. Also in ASP.NET applications, using an InProc cache instance is not considered as the best option due process memory limitation. However, note that there will be an overhead of transferring data between application process and the cache itself.
 
 
Local Cache is the only cache available in developer edition of NCache, but remote clients for local cache are not supported in this edition.
 
 
See Also