Skip to content
Draft
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.
116 changes: 116 additions & 0 deletions content/operate/kubernetes/flex/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: Get started with Redis Flex on Kubernetes
alwaysopen: false
categories:
- docs
- operate
- kubernetes
description: Configure Redis Flex on your Redis Enterprise cluster for Kubernetes.
hideListLinks: true
linkTitle: Get started
weight: 20
---

This guide shows you how to configure Redis Flex on your Redis Enterprise cluster for Kubernetes.

## 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
- Locally attached NVMe SSDs on your worker nodes
- A StorageClass configured for Flash storage

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

## Configure the cluster for Redis Flex

To enable Redis Flex, configure your `RedisEnterpriseCluster` (REC) resource with Flash storage settings.

### Step 1: Create a StorageClass for Flash storage

Create a StorageClass that references your locally attached SSDs.

Key fields in the StorageClass:

| Field | Description |
|---------------------|-----------------------------------------------------------|
| `provisioner` | Set to `kubernetes.io/no-provisioner` for local storage. |
| `volumeBindingMode` | Set to `WaitForFirstConsumer` for local volumes. |

### Step 2: Configure Flash storage in the REC

Add the `redisOnFlashSpec` section to your REC specification.

Key fields in `redisOnFlashSpec`:

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

### Step 3: Apply the configuration

1. Apply the updated REC configuration:

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

2. Verify that the cluster is ready:

```sh
kubectl get rec
```

## Create a Redis Flex database

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

### Configure the REDB

Create a database specification with `isRof` set to `true`.

Key fields in the REDB:

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

### Apply the database configuration

1. Apply the REDB:

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

2. Verify the database status:

```sh
kubectl get redb
```

## Verify Redis Flex is active

To confirm that Redis 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