|
14 | 14 | * Redis-based implementation of {@link CacheTagsStore}. |
15 | 15 | * |
16 | 16 | * <p> |
17 | | - * This implementation stores tag-to-key mappings in Redis using Redis Sets. |
18 | | - * It is suitable for distributed systems, clustered deployments, or scenarios |
19 | | - * where |
20 | | - * tag associations need to be shared across multiple application instances. |
| 17 | + * This implementation stores tag-to-key mappings in Redis using Redis Sets |
| 18 | + * (one Redis Set per tag). It is intended for distributed or clustered |
| 19 | + * deployments where tag associations must be shared between application |
| 20 | + * instances. |
| 21 | + * </p> |
21 | 22 | * |
22 | 23 | * <p> |
23 | | - * <b>Features:</b> |
| 24 | + * <b>Behavior and guarantees</b>: |
24 | 25 | * <ul> |
25 | | - * <li>Distributed tag mappings across multiple instances</li> |
26 | | - * <li>Automatic data persistence</li> |
27 | | - * <li>Thread-safe operations through Redis</li> |
28 | | - * <li>Suitable for high-concurrency environments</li> |
| 26 | + * <li>Associations are stored in Redis Sets (atomic, concurrent-safe on the |
| 27 | + * Redis side).</li> |
| 28 | + * <li>Entries are stored as strings in the format {@code {cacheName}:{key}}, |
| 29 | + * where {@code key} is obtained via {@code toString()} on the provided key |
| 30 | + * object.</li> |
| 31 | + * <li>TTL (expiration) is applied per-tag when the configured |
| 32 | + * {@code RedisCacheConfiguration#getTtlFunction()} returns a positive |
| 33 | + * {@code Duration} for the tag. TTL is set using {@code RedisTemplate.expire}. |
| 34 | + * </li> |
| 35 | + * <li>Methods are null-tolerant: missing Redis Set members produce no entries |
| 36 | + * and the lookup returns an empty map when no associations are found.</li> |
29 | 37 | * </ul> |
30 | | - * |
31 | | - * <p> |
32 | | - * <b>Redis Data Structure:</b> |
33 | | - * <ul> |
34 | | - * <li>Keys: "tag:{tagName}" (Redis Set)</li> |
35 | | - * <li>Values: "{cacheName}:{key}" (serialized cache references)</li> |
36 | | - * </ul> |
37 | | - * |
38 | | - * <p> |
39 | | - * <b>Example:</b> |
40 | | - * |
41 | | - * <pre> |
42 | | - * SET tag:user:123 user-cache:123:details |
43 | | - * SET tag:user:123 user-cache:123:permissions |
44 | | - * SET tag:type:admin admin-cache:456:settings |
45 | | - * </pre> |
| 38 | + * </p> |
46 | 39 | * |
47 | 40 | * @author intellinside |
48 | 41 | * @see CacheTagsStore |
|
0 commit comments