NCache 4.6 - Online Documentation

Local Cache

NCache supports a standalone (non-clustered) cache which resides on a single node. See the Configuring Caches section in Administrator’s Guide for detail. Local cache is similar in features to other clustered caches, i.e. it has all 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, you can not increase its span to multiple servers to raise its transactional capacity (scalability issue).
Moreover, since it creates a single cache instance (no backup or replica), you will lose all of your cached data if the cache goes down. Thus, local cache is suitable for applications having a small number of clients with low activity or where applications do not need to cache large amount of data.
Isolation Levels
A local cache has following two isolation levels:
  • InProc: This isolation level means that the cache resides inside the memory space of the client application. This type of cache exists inside your application process so you can take advantage of a faster response time. In InProc, NCache keeps cached data as live objects (not in serialized form) which reduces the serialization/de-serialization cost. However, since your application and the cache are sharing the same memory, you may face memory limitation in InProc cache. Also cached data in this case can not be shared with applications running outside this process.
Since objects are stored in the same address space as the cache client, cache clients get the reference to cached objects instead of a copy. For multithreaded applications, where multiple threads are modifying the same object, you are required to synchronize the changes to these objects using various synchronization techniques available in Java and .NET frameworks.
Although objects are not kept in serialized form in InProc caches, it still is required to have all objects marked as Serializable. NCache calculates the size of objects by serializing the objects which later helps in eviction when it is needed.
  • OutProc: This isolation level means that cache resides in a separate process (NCache service process) other than client application. Multiple clients (local and remote) can connect to the same cache to share the data. Here you will face more latency than InProc cache because of the communication cost outside the process.
You can use OutProc local cache when multiple clients’ application needs to access the same cached data. For example, in a web garden where each JSP/ASP.NET application runs in a separate worker process, OutProc cache is the required cache data for multiple applications. It is also suitable in case of JSP/ASP.NET applications where using an InProc cache instance is not considered as the best option due to process memory limitation. However, note that there will be an overhead of transferring data between your 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