Terracotta 10.7 | Ehcache API Developer Guide | Hybrid Caching | Configuring a Hybrid Cache
 
Configuring a Hybrid Cache
Hybrid caches can be configured by specifying a dataPercent value at the ResourcePool configuration level. dataPercent signifies the percentage of cache data to be kept in the off-heap tier. If the cache data exceeds this limit, it goes to the disk, provided that the metadata is large enough to store this information; else cache eviction will be triggered.
Note: 
*Hybrid caches only support dedicated resource pools. Thus, it would be illegal to create a hybrid cache using shared restartable resource pools.
*Conceptually, a hybrid Cache with a dataPercent of 100 is not equal to a full Cache.
Let us consider an example configuration where a Cache uses a ResourcePool of size 1 GB. Consider the following:
Data Percent value
Description
0 (default value)
This is a 'Pure Hybrid' configuration where all cache data will reside on disk and all metadata will reside in off-heap. The ResourcePool will be used only to store metadata, and can contain metadata for approximately 26 million entries, irrespective of the Cache key type.
Evictions will happen when the entries exceed this number.
50
512 MB of the ResourcePool will be used to store cache entries, and the remaining 512 MB to store metadata. The number of entries in the cached data portion is not predictable and depends on Cache key size, data size, operations performed on the Cache etc. The number of entries in the metadata can be computed as approximately 8 million.
Evictions will happen when the entries exceed this number.
95
972.8 MB of the ResourcePool will be used to store cache entries, and the remaining 51.2 MB to store metadata. As mentioned above - the number of entries in the cached data portion is not predictable and depends on Cache key size, data size, operations performed on the Cache etc. The number of entries in the metadata can be computed as approximately 0.8 million.
Evictions will happen when the entries exceed this number.