diff --git a/redisson-mybatis/README.md b/redisson-mybatis/README.md index 015858d38..5e882b5e8 100644 --- a/redisson-mybatis/README.md +++ b/redisson-mybatis/README.md @@ -4,23 +4,31 @@ Implements [MyBatis Cache](https://mybatis.org/mybatis-3/sqlmap-xml.html#cache) Compatible with MyBatis 3.0.0+ -Redisson provides various MyBatis Cache implementations including those with features below: +Redisson provides various MyBatis Cache implementations with features below: -**local cache** - so called `near cache`, which is useful for use cases when MyBatis Cache used mostly for read operations and/or network roundtrips are undesirable. It caches Map entries on Redisson side and executes read operations up to **45x faster** in comparison with common implementation. All local caches with the same name connected to the same pub/sub channel which is used for messaging between them. In particular to send entity update or entity invalidate event. +**local cache** - so called `near cache` used to speed up read operations and avoid network roundtrips. It caches Map entries on Redisson side and executes read operations up to **45x faster** in comparison with common implementation. Local cache instances with the same name connected to the same pub/sub channel. This channel is used for exchanging of update/invalidate events between all instances. Local cache store doesn't use `hashCode()`/`equals()` methods of key object, instead it uses hash of serialized state. -**data partitioning** - allows to scale available memory, read/write operations and entry eviction process for individual MyBatis Cache instance in Redis cluster. +**data partitioning** - although Map object is cluster compatible its content isn't scaled/partitioned across multiple Redis master nodes in cluster. Data partitioning allows to scale available memory, read/write operations and entry eviction process for individual Map instance in Redis cluster. -Below is the list of all available implementations with local cache and/or data partitioning support: +**scripted entry eviction** - allows to define `time to live` or `max idle time` parameters per map entry. Redis hash structure doesn't support eviction thus it's done on Redisson side through a custom scheduled task which removes expired entries using Lua script. Eviction task is started once by getMapCache() method execution per unique object name. So even if instance isn't used and has expired entries it should be get through getMapCache() method to start the eviction process. This leads to extra Redis calls and eviction task per unique map object name. -|Class name | Local cache | Data
partitioning | Ultra-fast
read/write | -| ------------- | :-----------: | :----------:| :----------:| -|RedissonCache
open-source version | ❌ | ❌ | ❌ | -|RedissonCache
[Redisson PRO](http://redisson.pro) version | ❌ | ❌ | ✔️ | -|RedissonCacheV2
[Redisson PRO](http://redisson.pro) version | ❌ | ✔️ | ✔️ | -|RedissonLocalCachedCache
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ❌ | ✔️ | -|RedissonLocalCachedCacheV2
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ✔️ | ✔️ | -|RedissonClusteredCache
available only in [Redisson PRO](http://redisson.pro) | ❌ | ✔️ | ✔️ | -|RedissonClusteredLocalCachedCache
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ✔️ | ✔️ | +**advanced entry eviction** - allows to define `time to live` parameter per map entry. Doesn't use an entry eviction task. + +**native entry eviction** - allows to define `time to live` parameter per map entry. Doesn't use an entry eviction task. Requires **Redis 7.4+**. + +Below is the list of all MyBatis Cache implementations: + +|Class name | Local
cache | Data
partitioning | Entry
eviction | Ultra-fast
read/write | +| ------------- | :-----------: | :----------:| :----------:| :----------:| +|RedissonCache
open-source version | ❌ | ❌ | **scripted**| ❌ | +|RedissonCacheNative
open-source version | ❌ | ❌ | **native**| ❌ | +|RedissonCache
[Redisson PRO](http://redisson.pro) version | ❌ | ❌ | **scripted** | ✔️ | +|RedissonCacheNative
open-source version | ❌ | ❌ | **native**| ✔️ | +|RedissonCacheV2
[Redisson PRO](http://redisson.pro) version | ❌ | ✔️ | **advanced** | ✔️ | +|RedissonLocalCachedCache
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ❌ | **scripted** | ✔️ | +|RedissonLocalCachedCacheV2
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ✔️ | **advanced** | ✔️ | +|RedissonClusteredCache
available only in [Redisson PRO](http://redisson.pro) | ❌ | ✔️ | **scripted** | ✔️ | +|RedissonClusteredLocalCachedCache
available only in [Redisson PRO](http://redisson.pro) | ✔️ | ✔️ | **scripted** | ✔️ | ## MyBatis Cache Usage