NitroCache Wiki
Extremely fast, scalable, concurrent, pure Java In-memory cache
Status: Beta
Brought to you by:
hviseria
NitroCache is a 100% pure java in-memory cache. It is designed with an aim to provide high throughput, extremely fast and scalable cache api. It uses concepts of B-tree, Hashing and Skiplist to optimize performance. Result is, its one of the fastest in-memory cache in java providing constant time fetches.
A simple, consistent and high-performance cache to boost system performance.
Under load, performance of most caches degrades linearly or exponentially with increase in number of concurrent threads. Because NitroCache uses lock-free algorithm for fetching data, the performance is almost constant with any number of threads.
NitroCache<String,String> _cache = null;
// Every call to NitroCache.getInstance will create new cache. Its not singleton
_cache = NitroCache.getInstance(5000, CacheEviction.FIFO);
_cache.put("1000","hello world");
System.out.println(_cache.get("1000");
Mode | Description | Suggested Usage |
---|---|---|
FIFO | Standard First-in-first-out algorithm. put(key,null) will remove the entry and compacts cache. Adding same key/value again moves the entry to end. | Frequent removal and re-entry of key/values |
FIFO_V2 | Optimized for speed FIFO. put(key,null) removes entry but does not immediately compact cache. Adding same key/value again does not change order of entry in FIFO queue | Less frequent removal/replace of values for keys. High throughput. |
LRU | Standard Least Recently Used algorithm | If LRU provides more hits |
See [Performance]section for details