From b44f18c04a1bc4212976ec4e70db736d1f0b4016 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Fri, 23 Aug 2024 08:54:07 +0300 Subject: [PATCH] Update README.md --- redisson-quarkus/README.md | 61 +++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/redisson-quarkus/README.md b/redisson-quarkus/README.md index 9b0671d6e..32a0e37bd 100644 --- a/redisson-quarkus/README.md +++ b/redisson-quarkus/README.md @@ -59,27 +59,46 @@ Redisson provides various Cache implementations with multiple important features **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. -**`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. - -**`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 Cache implementations: - -|`impementation`
setting value | Local
cache | Data
partitioning | Entry
eviction | Ultra-fast
read/write | -| ------------- | :-----------: | :-----------:| :----------:| :---------:| -|`standard`
open-source version | ❌ | ❌ | **scripted** | ❌ | -|`native`
open-source version | ❌ | ❌ | **native**| ❌ | -|`standard`
[Redisson PRO](https://redisson.pro) version | ❌ | ❌ | **scripted** | ✔️ | -|`native`
[Redisson PRO](https://redisson.pro) version | ❌ | ❌ | **native**| ✔️ | -|`v2`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | **advanced** | ✔️ | -|`localcache`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ❌ | **scripted** | ✔️ | -|`localcache_v2`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | **advanced** | ✔️ | -|`localcache_native`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | **native** | ✔️ | -|`clustered`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | **scripted** | ✔️ | -|`clustered_native`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | **native** | ✔️ | -|`clustered_localcache`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | **scripted** | ✔️ | +#### 1. Scripted 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 per unique object name at the moment of getting Map instance. If instance isn't used and has expired entries it should be get again to start the eviction process. This leads to extra Redis calls and eviction task per unique map object name. + +Entries are cleaned time to time by `org.redisson.eviction.EvictionScheduler`. By default, it removes 100 expired entries at a time. This can be changed through [cleanUpKeysAmount](https://github.com/redisson/redisson/wiki/2.-Configuration#cleanupkeysamount) setting. Task launch time tuned automatically and depends on expired entries amount deleted in previous time and varies between 5 second to 30 minutes by default. This time interval can be changed through [minCleanUpDelay](https://github.com/redisson/redisson/wiki/2.-Configuration#mincleanupdelay) and [maxCleanUpDelay](https://github.com/redisson/redisson/wiki/2.-Configuration#maxcleanupdelay). For example, if clean task deletes 100 entries each time it will be executed every 5 seconds (minimum execution delay). But if current expired entries amount is lower than previous one then execution delay will be increased by 1.5 times and decreased otherwise. + +Available implementations: + +|`impementation`
setting value | Local
cache | Data
partitioning | Ultra-fast
read/write | +| ------------- | :-----------: | :-----------:| :----------:| +|`standard`
open-source version | ❌ | ❌ | ❌ | +|`standard`
[Redisson PRO](https://redisson.pro) version | ❌ | ❌ | ✔️ | +|`localcache`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ❌ | ✔️ | +|`clustered`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | ✔️ | +|`clustered_localcache`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | ✔️ | + +#### 2. Advanced eviction + +Allows to define `time to live` parameter per map entry. Doesn't use an entry eviction task, entries are cleaned on Redis side. + +Available implementations: + +|`impementation`
setting value | Local
cache | Data
partitioning | Ultra-fast
read/write | +| ------------- | :-----------: | :-----------:| :----------:| +|`v2`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | ✔️ | +|`localcache_v2`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | ✔️ | + +#### 3. Native eviction + +Allows to define `time to live` parameter per map entry. Doesn't use an entry eviction task, entries are cleaned on Redis side. +Requires **Redis 7.4+**. + +Available implementations: + +|`impementation`
setting value | Local
cache | Data
partitioning | Ultra-fast
read/write | +| ------------- | :-----------: | :-----------:| :----------:| +|`native`
open-source version | ❌ | ❌ | ❌ | +|`native`
[Redisson PRO](https://redisson.pro) version | ❌ | ❌ | ✔️ | +|`localcache_native`
available only in [Redisson PRO](https://redisson.pro) | ✔️ | ✔️ | ✔️ | +|`clustered_native`
available only in [Redisson PRO](https://redisson.pro) | ❌ | ✔️ | ✔️ | #### 2.1. Cache settings