The Carbon Java Framework  

The Carbon Cache Module

Cache Service Design

Printer Friendly Version


The default Carbon cache service provides a standard method for caching data in an in-memory map structure. This can greatly improve performance accessing frequently-used data that is loaded from a slow resource such as a file system, database, main frame, web service, etc.

Carbon provides two types of cache implementations:

  • The TotalCache is used to load all information into the cache. The cache may be refreshed periodically as a whole or using JMX services.
  • The Most-Recently-Used (MRU) Cache is used to keep the most recently used cached items in memory. This is most useful when the backing store may have a large amount of data, but a small amount of it is requested most of the time. The MRU cache hit/miss statistics can be monitored with JMX and configured in the running system to optimize performance.

Developing a new cache only requires the developer to write a DataLoader object that the Carbon service can call when it needs to load the data into the cache.

Copyright © 2001-2003, Sapient Corporation