Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions content/operate/kubernetes/flex/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: Flex on Kubernetes
alwaysopen: false
categories:
- docs
- operate
- kubernetes
description: Extend Redis databases with flash storage for large-scale, cost-efficient deployments on Kubernetes.
hideListLinks: true
linkTitle: Flex
weight: 41
---

Flex extends your database capacity by combining RAM and flash (SSD) storage. This tiered architecture keeps frequently accessed (hot) data in RAM for sub-millisecond latency while storing less active (warm) data on flash to reduce costs and increase capacity.

Flex databases work with your existing Redis applications and the Redis API without modification.

## How Flex works

### Automatic data tiering

Flex moves data between RAM and flash based on access patterns:

- Frequently accessed data stays in high-speed RAM.
- Less active data moves to cost-efficient flash storage.
- Data accessed from flash promotes back to RAM automatically.

Redis uses an [LRU (least recently used)]({{< relref "/develop/reference/eviction#apx-lru" >}}) eviction policy to manage data placement. When memory pressure increases, Flex identifies cold objects, transfers them to flash, and frees RAM for new or frequently accessed keys.

This process requires no application changes. Your existing Redis commands work across both storage tiers.

### Utilization-aware RAM population

Flex uses a hybrid memory model that balances performance with predictable behavior as the dataset grows. The goal is to maximize hot data in RAM while maintaining stable performance across all utilization levels.

Flex considers both the configured RAM percentage and current dataset utilization:

- When database utilization is below 50%, Flex uses up to 50% of configured RAM for hot data.
- Above 50% utilization, Flex uses both RAM and flash proportionally, following the configured RAM-to-flash ratio.

This ensures:

- A stable performance curve across all utilization levels
- No sudden drop-off in RAM hit-rate as the database fills
- Predictable throughput and latency, especially for large deployments

### Storage engine

Flex uses [Speedb](https://docs.speedb.io), a high-performance key-value storage engine optimized for flash drives:

- Redis handles all data operations in memory.
- Speedb manages the flash storage layer.

This design delivers predictable latency and throughput as datasets grow beyond RAM limits.

## Compatibility

Flex is compatible with the Redis API and supports all Redis data types, including JSON and probabilistic data structures (Bloom filters, Count-Min Sketch, Top-K).

The following features are not yet supported with Flex:

- Redis Query Engine (RQE)
- Time series
- Active-Active

## When to use Flex

Use Flex when you need to:

- Run Redis at terabyte scale while maintaining high throughput and sub-10 ms latency
- Power real-time feature stores for machine learning applications
- Operate large distributed caches with elastic scaling and consistent performance under heavy load
- Reduce infrastructure costs by combining high-speed RAM with cost-efficient flash storage

{{<note>}}Flex does not replace long-term data persistence. For workloads that require durability and recovery across restarts or failures, use Redis persistence features like [AOF (Append-Only File)]({{< relref "/operate/oss_and_stack/management/persistence#append-only-file" >}}), [RDB snapshots]({{< relref "/operate/oss_and_stack/management/persistence#snapshotting" >}}), or both. For more information, see [Database persistence]({{< relref "/operate/rs/databases/configure/database-persistence" >}}).{{</note>}}

## Flex and Auto Tiering

Flex replaces [Auto Tiering]({{< relref "/operate/kubernetes/7.22/re-clusters/auto-tiering" >}}) (formerly known as Redis on Flash). Redis Enterprise selects the implementation based on your database version:

| Redis database version | Operator version | Redis Flex | Auto Tiering |
|------------------------|------------------|------------|--------------|
| 8.0 and later | 8.0.2-2 and later | <span title="Supported">&#x2705;</span> | <span title="Not supported">&#x274c;</span> |
| 7.4 | 7.8.2-6 and later | <span title="Supported">&#x2705;</span> | <span title="Supported">&#x2705;</span> |
| 7.2 and earlier | 7.22.2-22 and earlier | <span title="Not supported">&#x274c;</span> | <span title="Supported">&#x2705;</span> |

For Redis Enterprise for Kubernetes version 7.22.2-22 or earlier, see [Auto Tiering]({{< relref "/operate/kubernetes/7.22/re-clusters/auto-tiering" >}}).

### Differences between Flex and Auto Tiering

- Key and value offloading
- Auto Tiering offloads only values to flash while keys remain in RAM.
- Flex offloads both keys and values, which increases dataset density per node and reduces RAM consumption.
- RAM requirements
- Auto Tiering requires enough RAM to hold all keys.
- Flex has no requirement to keep keys in RAM. Minimum RAM is based on performance goals, not key count. The minimum RAM-to-flash ratio is 10%, which enables high flash utilization without compromising architecture.
- RAM population strategy
- Auto Tiering fills all available RAM before offloading data to flash. This maximizes hot-data performance but can cause non-linear performance changes at high utilization.
- Flex uses utilization-aware RAM population.
- Storage engine
- Auto Tiering uses either RocksDB or Speedb as the storage engine.
- Flex uses Speedb only.
- Hot data caching and dataset size
- Auto Tiering is limited by key memory overhead, which restricts maximum dataset size.
- Flex is more efficient because RAM holds hot keys and values, supporting larger datasets.
- Performance consistency
- Auto Tiering depends on RAM pressure and key count.
- Flex provides higher RAM hit-rate and more stable latency.

## Next steps

- [Plan your deployment]({{< relref "/operate/kubernetes/flex/plan" >}}): Review hardware requirements, sizing guidelines, and limitations.
- [Get started]({{< relref "/operate/kubernetes/flex/get-started" >}}): Configure Flex on your cluster.
- [Scale your deployment]({{< relref "/operate/kubernetes/flex/scale" >}}): Learn scaling strategies and best practices.
93 changes: 93 additions & 0 deletions content/operate/kubernetes/flex/auto-tiering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
Title: Use Auto Tiering on Kubernetes
alwaysopen: false
categories:
- docs
- operate
- kubernetes
description: Deploy a cluster with Auto Tiering on Kubernetes.
linkTitle: Auto Tiering
weight: 40
---

{{<note>}}
This page applies to Redis database version 7.4 and earlier. If you use version 8.0 or later, see [Redis Flex](https://redis.io/docs/latest/operate/kubernetes/re-clusters/redis-flex).
{{</note>}}

## Prerequisites

Redis Enterprise Software for Kubernetes supports using Auto Tiering (previously known as Redis on Flash), which extends your node memory to use both RAM and flash storage. SSDs (solid state drives) can store infrequently used (warm) values while your keys and frequently used (hot) values are still stored in RAM. This improves performance and lowers costs for large datasets.

{{<note>}}
NVMe (non-volatile memory express) SSDs are strongly recommended to achieve the best performance.
{{</note>}}

Before creating your Redis clusters or databases, these SSDs must be:

- [locally attached to worker nodes in your Kubernetes cluster](https://kubernetes.io/docs/concepts/storage/volumes/#local)
- formatted and mounted on the nodes that will run Redis Enterprise pods
- dedicated to Auto Tiering and not shared with other parts of the database, (e.g. durability, binaries)
- [provisioned as local persistent volumes](https://kubernetes.io/docs/concepts/storage/volumes/#local)
- You can use a [local volume provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/blob/master/README.md) to do this [dynamically](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic)
- a [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/#local) resource with a unique name

For more information on node storage, see [Node persistent and ephemeral storage]({{< relref "/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage" >}}).

## Create a Redis Enterprise cluster

To deploy a Redis Enterprise cluster (REC) with Auto Tiering, you'll need to specify the following in the `redisOnFlashSpec` section of your [REC custom resource]({{< relref "/operate/kubernetes/7.22/reference/api/redis_enterprise_cluster_api" >}}):

- enable Auto Tiering (`enabled: true`)
- flash storage driver (`bigStoreDriver`)
- `rocksdb` or `speedb`(default)
- storage class name (`storageClassName`)
- minimal flash disk size (`flashDiskSize`)

{{<note>}} Clusters upgraded to version 7.2.4-2 from an earlier version will change the `bigStoreDriver` (previously called `flashStorageEngine`) to the new default `speedb`, regardless of previous configuration. {{</note>}}

{{<warning>}}Switching between storage engines (`speedb` and `rocksdb`) requires guidance by Redis Support or your Account Manager.{{</warning>}}

{{<warning>}}PVC expansion is not supported when using Auto Tiering. Do not enable `enablePersistentVolumeResize` in the REC `persistentSpec` if you are using `redisOnFlashSpec` as this will result in conflicts. {{</warning>}}

Here is an example of an REC custom resource with these attributes:

```YAML
apiVersion: app.redislabs.com/v1
kind: RedisEnterpriseCluster
metadata:
name: "rec"
spec:

nodes: 3
redisOnFlashSpec:
enabled: true
bigStoreDriver: speedb
storageClassName: local-scsi
flashDiskSize: 100G
```

### Create a Redis Enterprise database

By default, any new database will use RAM only. To create a Redis Enterprise database (REDB) that can use flash storage, specify the following in the `redisEnterpriseCluster` section of the REDB custom resource definition:

- `isRof: true` enables Auto Tiering
- `rofRamSize` defines the RAM capacity for the database

Below is an example REDB custom resource:

```YAML
apiVersion: app.redislabs.com/v1alpha1
kind: RedisEnterpriseDatabase
metadata:
name: autoteiring-redb
spec:
redisEnterpriseCluster:
name: rec
isRof: true
memorySize: 2GB
rofRamSize: 0.5GB
```

{{< note >}}
This example defines both `memorySize` and `rofRamSize`. When using Auto Tiering, `memorySize` refers to the total combined memory size (RAM + flash) allocated for the database. `rofRamSize` specifies only the RAM capacity for the database. `rofRamSize` must be at least 10% of `memorySize`.
{{< /note >}}
136 changes: 136 additions & 0 deletions content/operate/kubernetes/flex/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
title: Get started with Flex on Kubernetes
alwaysopen: false
categories:
- docs
- operate
- kubernetes
description: Configure Flex on your Redis Enterprise cluster for Kubernetes.
hideListLinks: true
linkTitle: Get started
weight: 20
aliases: /operate/kubernetes/re-clusters/redis-flex/
---

{{<note>}}
This page applies to Redis database version 7.4 and earlier using Auto Tiering. If you use version 8.0 or later, see [Redis Flex](https://redis.io/docs/latest/operate/kubernetes/flex/).
{{</note>}}

Flex extends your database capacity by combining RAM and flash (SSD) storage. This tiered architecture keeps frequently accessed (hot) data in RAM for sub-millisecond latency while storing less active (warm) data on flash to reduce costs and increase capacity.

## Prerequisites

Before you begin, verify that you have:

- Redis Enterprise for Kubernetes version 8.0.2-2 or later installed
- A running `RedisEnterpriseCluster` (REC) resource
- Redis database version 7.4 or later
- Locally attached NVMe SSDs on your worker nodes
- A StorageClass configured for flash storage with a unique name

For hardware requirements and sizing guidelines, see [Plan your deployment]({{< relref "/operate/kubernetes/flex/plan" >}}).

## Configure the REC for Flex

To enable Flex, configure your `RedisEnterpriseCluster` (REC) resource with flash storage settings. Add the [`redisOnFlashSpec`]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_cluster_api#specredisonflashspec">}}) section to your REC specification.

Key fields in `redisOnFlashSpec`:

| Field | Description |
|-------------------------|--------------------------------------------------|
| `enabled` | Set to `true` to enable Flex. |
| `flashStorageClassName` | Name of the StorageClass for flash storage. |
| `flashDiskSize` | Size of the flash storage per node. |
| `storageEngine` | Storage engine. Set to `speedb` for Flex. |

For all available fields, see the [REC API reference]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_cluster_api#specredisonflashspec">}}).

{{<warning>}}
PVC expansion is not supported when using Flex. Do not enable `enablePersistentVolumeResize` in the REC `persistentSpec` if you are using `redisOnFlashSpec` as this will result in conflicts.
{{</warning>}}

1. Create a REC specification file with flash storage settings similar to the following example:

```yaml
apiVersion: app.redislabs.com/v1
kind: RedisEnterpriseCluster
metadata:
name: rec
spec:
nodes: 3
redisOnFlashSpec:
enabled: true
flashStorageClassName: local-flash
flashDiskSize: 100Gi
storageEngine: speedb
```

1. Apply the REC configuration:

```sh
kubectl apply -f rec.yaml
```

1. Verify that the cluster is ready:

```sh
kubectl get rec
```

## Create a Flex database

After you configure the cluster, create a `RedisEnterpriseDatabase` (REDB) resource with Flex enabled.

Key fields in the REDB:

| Field | Description |
|--------------|--------------------------------------------------------|
| `memorySize` | Total database size (RAM + flash). |
| `isRof` | Set to `true` to enable Flex for this database. |
| `rofRamSize` | Amount of RAM allocated to the database. |

For all available fields, see the [REDB API reference]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_database_api">}}).

1. Create a database specification file with `isRof` set to `true` similar to the following example:

```yaml
apiVersion: app.redislabs.com/v1alpha1
kind: RedisEnterpriseDatabase
metadata:
name: flex-db
spec:
memorySize: 10Gi
isRof: true
rofRamSize: 2Gi
```

1. Apply the REDB:

```sh
kubectl apply -f redb.yaml
```

1. Verify the database status:

```sh
kubectl get redb
```

## Verify Flex is active

To confirm that Flex is working:

1. Check the database status:

```sh
kubectl get redb <database-name> -o yaml
```

2. Look for `isRof: true` in the status section.

3. Connect to the database and verify that data operations work correctly.

## Next steps

- [Scale your deployment]({{< relref "/operate/kubernetes/flex/scale" >}}): Learn how to scale volume, throughput, and infrastructure.
- [Plan your deployment]({{< relref "/operate/kubernetes/flex/plan" >}}): Review sizing guidelines and best practices.
Loading
Loading