Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS and RC: Client-side caching and compatibility #550

Merged
merged 7 commits into from
Sep 16, 2024
Prev Previous commit
Next Next commit
DOC-3951 RS: Client-side caching and compatibility
  • Loading branch information
rrelledge committed Aug 14, 2024
commit de20597b8572857ee54d5985fd33bdabc949d01c
8 changes: 7 additions & 1 deletion content/operate/rs/databases/memory-performance/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,10 @@ If applications need to access a value that is in flash, Redis
Enterprise automatically brings the value into RAM. Depending on the
flash hardware in use, applications experience slightly higher latency
when bringing values back into RAM from flash. However subsequent
accesses to the same value is fast, once the value is in RAM.
accesses to the same value is fast, once the value is in RAM.

## Client-side caching

Client-side caching allows Redis clients to store a subset of data in a local cache and avoid sending repeated requests to the Redis database. When used to cache frequently accessed data, this technique can improve performance by decreasing network traffic, latency, and load on the database. For more information about client-side caching, see the [client-side caching introduction]({{<relref "/develop/connect/clients/client-side-caching">}}).

Redis Software supports client-side caching for databases with Redis versions 7.4 and later. See [Client-side caching compatibility with Redis Software]({{<relref "/operate/rs/references/compatibility/client-side-caching">}}) for more information about compatibility and configuration options.
84 changes: 84 additions & 0 deletions content/operate/rs/references/compatibility/client-side-caching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
Title: Client-side caching compatibility with Redis Software and Redis Cloud
alwaysopen: false
categories:
- docs
- operate
- rs
description: Redis Software and Redis Cloud compatibility with client-side caching.
linkTitle: Client-side caching
toc: 'true'
weight: 80
---

Redis Software and Redis Cloud support [client-side caching]({{<relref "/develop/connect/clients/client-side-caching">}}) for databases with Redis versions 7.4 or later.

## Required database versions

Client-side caching in Redis Software and Redis Cloud requires Redis database versions 7.4 or later.

The following table shows the differences in client-side caching support by product:

| Redis product | Client-side caching support |
|-------------------------|-----------------------------|
| Redis Community Edition | Redis v6.0 and later |
| Redis Cloud | Redis database v7.4 and later |
| Redis Software | Redis database v7.4 and later |

## Supported RESP versions

Client-side caching in Redis Software and Redis Cloud requires RESP3.
rrelledge marked this conversation as resolved.
Show resolved Hide resolved

The following table shows the differences in client-side caching support for RESP by product:

| Redis product with client-side caching | RESP2 | RESP3 |
|-------------------------|-------|-------|
| Redis Community Edition | <span title="Supported">&#x2705;</span> | <span title="Supported">&#x2705;</span> |
| Redis Cloud | <span title="Not supported">&#x274c;</span> | <span title="Supported">&#x2705;</span> |
| Redis Software | <span title="Not supported">&#x274c;</span> | <span title="Supported">&#x2705;</span> |

## Two connections mode with REDIRECT not supported

Unlike Redis Community Edition, Redis Software and Redis Cloud do not support [two connections mode]({{<relref "/develop/reference/client-side-caching#two-connections-mode">}}) or the `REDIRECT` option for [`CLIENT TRACKING`]({{<relref "/commands/client-tracking">}}).

## Change tracking_table_max_keys for a database

When client-side caching is enabled, Redis uses an invalidation table to track which keys are cached by each connected client.

The configuration setting `tracking-table-max-keys` determines the maximum number of keys stored in the invalidation table and is set to `1000000` keys by default. Redis Software does not support using `CONFIG SET` to change this value, but you can use the REST API or rladmin instead.

To change `tracking_table_max_keys` for a database in a Redis Software cluster:

- [`rladmin tune db`]({{<relref "/operate/rs/references/cli-utilities/rladmin/tune#tune-db">}}):

```sh
rladmin tune db db:<ID> tracking_table_max_keys 2000000
```

You can use the database name in place of `db:<ID>` in the preceding command.

- [Update database configuration]({{<relref "/operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) REST API request:

```sh
PUT /v1/bdbs/<uid>
{ "tracking_table_max_keys": 2000000 }
```

## Change default tracking_table_max_keys

The cluster-wide option `default_tracking_table_max_keys_policy` determines the default value of `tracking_table_max_keys` for new databases in a Redis Software cluster. `default_tracking_table_max_keys_policy` is set to `1000000` keys by default.

To change `default_tracking_table_max_keys_policy`, use one of the following methods:

- [`rladmin tune cluster`]({{<relref "/operate/rs/references/cli-utilities/rladmin/tune#tune-cluster">}})

```sh
rladmin tune cluster default_tracking_table_max_keys_policy 2000000
```

- [Update cluster policy]({{<relref "/operate/rs/references/rest-api/requests/cluster/policy#put-cluster-policy">}}) REST API request:

```sh
PUT /v1/cluster/policy
{ "default_tracking_table_max_keys_policy": 2000000 }
```