You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-how-to-premium-persistence.md
+29-19Lines changed: 29 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,24 @@ description: Learn how to configure and manage data persistence your Premium tie
4
4
5
5
ms.custom: devx-track-azurecli
6
6
ms.topic: conceptual
7
-
ms.date: 04/10/2023
7
+
ms.date: 02/21/2025
8
8
---
9
9
# Configure data persistence for an Azure Cache for Redis instance
10
10
11
-
[Redis persistence](https://redis.io/topics/persistence) allows you to persist data stored in cache instance. If there's a hardware failure, the cache instance is rehydrated with data from the persistence file when it comes back online. The ability to persist data is an important way to boost the durability of a cache instance because all cache data is stored in memory. Data loss is possible if a failure occurs when cache nodes are down. Persistence should be a key part of your [high availability and disaster recovery](cache-high-availability.md) strategy with Azure Cache for Redis.
11
+
[Redis persistence](https://redis.io/topics/persistence) allows you to persist the data stored in cache instance. If there's a hardware failure, the cache instance is rehydrated with data from the persistence file when it comes back online. The ability to persist data is an important way to boost the durability of a cache instance because all cache data is stored in memory. Data loss is possible if a failure occurs when cache nodes are down. Persistence should be a key part of your [high availability and disaster recovery](cache-high-availability.md) strategy with Azure Cache for Redis.
12
+
13
+
> [!IMPORTANT]
14
+
>
15
+
> The data persistence functionality provides resilience for unexpected Redis node failures. Data persistence isn't a data backup or point in time recovery (PITR) feature. If corrupted data is written to the Redis instance, th corrupted data is also persisted. To make backups of your Redis instance, use the [export feature](cache-how-to-import-export-data.md).
16
+
>
12
17
13
18
> [!WARNING]
14
19
>
15
-
> If you are using persistence on the Premium tier, check to see if your storage account has soft delete enabled before using the data persistence feature. Using data persistence with soft delete causes very high storage costs. For more information, see [should I enable soft delete?](#how-frequently-does-rdb-and-aof-persistence-write-to-my-blobs-and-should-i-enable-soft-delete).
20
+
> If you're using persistence on the Premium tier, check to see if your storage account has soft delete enabled before using the data persistence feature. Using data persistence with soft delete causes high storage costs. For more information, see [should I enable soft delete?](#how-frequently-does-rdb-and-aof-persistence-write-to-my-blobs-and-should-i-enable-soft-delete).
16
21
>
17
22
18
23
>[!WARNING]
19
-
> The _always write_ option for AOF persistence on the Enterprise and Enterprise Flash tiers is set to be retired on April 1, 2025. This option has significant performance limitations is no longer recommended. Using the _write every second_ option or using RDB persistence is recommended instead.
24
+
> The _always write_ option for AOF persistence on the Enterprise and Enterprise Flash tiers is set to retire on April 1, 2025. This option has significant performance limitations is no longer recommended. Using the _write every second_ option or using RDB persistence is recommended instead.
20
25
>
21
26
22
27
## Scope of availability
@@ -48,11 +53,11 @@ Persistence features are intended to be used to restore data to the same cache a
48
53
49
54
## Differences between persistence in the Premium and Enterprise tiers
50
55
51
-
On the **Premium** tier, data is persisted directly to an [Azure Storage](../storage/common/storage-introduction.md) account that you own and manage. Azure Storage automatically encrypts data when it's persisted, but you can also use your own keys for the encryption. For more information, see [Customer-managed keys for Azure Storage encryption](../storage/common/customer-managed-keys-overview.md).
56
+
On the **Premium** tier, data is persisted directly to an [Azure Storage](../storage/common/storage-introduction.md) account that you own and manage. Azure Storage automatically encrypts data when persisting it, but you can also use your own keys for the encryption. For more information, see [Customer-managed keys for Azure Storage encryption](../storage/common/customer-managed-keys-overview.md).
52
57
53
58
> [!WARNING]
54
59
>
55
-
> If you are using persistence on the Premium tier, check to see if your storage account has soft delete enabled before using the data persistence feature. Using data persistence with soft delete causes very high storage costs. For more information, see [should I enable soft delete?](#how-frequently-does-rdb-and-aof-persistence-write-to-my-blobs-and-should-i-enable-soft-delete).
60
+
> If you're using persistence on the Premium tier, check to see if your storage account has soft delete enabled before using the data persistence feature. Using data persistence with soft delete causes high storage costs. For more information, see [should I enable soft delete?](#how-frequently-does-rdb-and-aof-persistence-write-to-my-blobs-and-should-i-enable-soft-delete).
56
61
>
57
62
58
63
On the **Enterprise** and **Enterprise Flash** tiers, data is persisted to a managed disk attached directly to the cache instance. The location isn't configurable nor accessible to the user. Using a managed disk increases the performance of persistence. The disk is encrypted using Microsoft managed keys (MMK) by default, but customer managed keys (CMK) can also be used. For more information, see [managing data encryption](#managing-data-encryption).
@@ -65,7 +70,7 @@ On the **Enterprise** and **Enterprise Flash** tiers, data is persisted to a man
65
70
66
71
:::image type="content" source="media/cache-how-to-premium-persistence/create-resource.png" alt-text="Screenshot that shows a form to create an Azure Cache for Redis resource.":::
67
72
68
-
2. On the **Create a resource** page, select **Databases** and then select **Azure Cache for Redis**.
73
+
2. On the **Create a resource** page, select **Databases**, and then select **Azure Cache for Redis**.
69
74
70
75
:::image type="content" source="media/cache-how-to-premium-persistence/select-cache.png" alt-text="Screenshot showing Azure Cache for Redis selected as a new database type.":::
71
76
@@ -100,7 +105,7 @@ On the **Enterprise** and **Enterprise Flash** tiers, data is persisted to a man
100
105
The first backup starts once the backup frequency interval elapses.
101
106
102
107
> [!NOTE]
103
-
> When RDB files are backed up to storage, they are stored in the form of page blobs. If you're using a storage account with HNS enabled, persistence will tend to fail because page blobs aren't supported in storage accounts with HNS enabled (ADLS Gen2).
108
+
> When RDB files are backed up to storage, they're stored in the form of page blobs. If you're using a storage account with HNS enabled, persistence tends to fail because page blobs aren't supported in storage accounts with HNS enabled (ADLS Gen2).
104
109
105
110
9. To enable AOF persistence, select **AOF** and configure the settings.
106
111
@@ -148,9 +153,9 @@ It takes a while for the cache to create. You can monitor progress on the Azure
148
153
1. Finish creating the cache by following the rest of the instructions in the [Enterprise tier quickstart guide](quickstart-create-redis-enterprise.md).
149
154
150
155
>[!WARNING]
151
-
> The _always write_ option for AOF persistence is set to be retired on April 1, 2025. This option has significant performance limitations is no longer recommended. Using the _write every second_ option or using RDB persistence is recommended instead.
156
+
> The _always write_ option for AOF persistence is set to retire on April 1, 2025. This option has significant performance limitations is no longer recommended. Using the _write every second_ option or using RDB persistence is recommended instead.
152
157
>
153
-
158
+
154
159
> [!NOTE]
155
160
> You can add persistence to a previously created Enterprise tier cache at any time by navigating to the **Advanced settings** in the Resource menu.
156
161
>
@@ -233,6 +238,7 @@ The following list contains answers to commonly asked questions about Azure Cach
233
238
-[How frequently does RDB and AOF persistence write to my blobs, and should I enable soft delete?](#how-frequently-does-rdb-and-aof-persistence-write-to-my-blobs-and-should-i-enable-soft-delete)
234
239
-[Will having firewall exceptions on the storage account affect persistence](#will-having-firewall-exceptions-on-the-storage-account-affect-persistence)
235
240
-[How do I check if soft delete is enabled on my storage account?](#how-do-i-check-if-soft-delete-is-enabled-on-my-storage-account)
241
+
-[Can I use a storage account in a different subscription from than the one where my cache is located?](#can-i-use-a-storage-account-in-a-different-subscription-from-than-the-one-where-my-cache-is-located)
236
242
237
243
### RDB persistence
238
244
@@ -275,15 +281,15 @@ For more information on performance when using AOF persistence, see [Does AOF pe
275
281
276
282
AOF persistence does affect throughput. AOF runs on both the primary and replica process, therefore you see higher CPU and Server Load for a cache with AOF persistence than an identical cache without AOF persistence. AOF offers the best consistency with the data in memory because each write and delete is persisted with only a few seconds of delay. The trade-off is that AOF is more compute intensive.
277
283
278
-
As long as CPU and Server Load are both less than 90%, there's a penalty on throughput, but the cache operates normally, otherwise. Above 90% CPU and Server Load, the throughput penalty can get much higher, and the latency of all commands processed by the cache increases. Latency increases because AOF persistence runs on both the primary and replica process, increasing the load on the node in use, and putting persistence on the critical path of data.
284
+
As long as CPU and Server Load are both less than 90%, there's a penalty on throughput, but the cache operates normally, otherwise. Above 90% CPU and Server Load, the throughput penalty can get higher, and the latency of all commands processed by the cache increases. Latency increases because AOF persistence runs on both the primary and replica process, increasing the load on the node in use, and putting persistence on the critical path of data.
279
285
280
286
### What happens if I've scaled to a different size and a backup is restored that was made before the scaling operation?
281
287
282
288
For both RDB and AOF persistence:
283
289
284
-
- If you've scaled to a larger size, there's no effect.
285
-
- If you've scaled to a smaller size, and you have a custom [databases](cache-configure.md#databases) setting that is greater than the [databases limit](cache-configure.md#databases) for your new size, data in those databases isn't restored. For more information, see [Is my custom databases setting affected during scaling?](cache-how-to-scale.md#is-my-custom-databases-setting-affected-during-scaling)
286
-
- If you've scaled to a smaller size, and there isn't enough room in the smaller size to hold all of the data from the last backup, keys are evicted during the restore process. Typically, keys are evicted using the [allkeys-lru](https://redis.io/topics/lru-cache) eviction policy.
290
+
- If you scaled to a larger size, there's no effect.
291
+
- If you scaled to a smaller size, and you have a custom [databases](cache-configure.md#databases) setting that is greater than the [databases limit](cache-configure.md#databases) for your new size, data in those databases isn't restored. For more information, see [Is my custom databases setting affected during scaling?](cache-how-to-scale.md#is-my-custom-databases-setting-affected-during-scaling)
292
+
- If you scaled to a smaller size, and there isn't enough room in the smaller size to hold all of the data from the last backup, keys are evicted during the restore process. Typically, keys are evicted using the [allkeys-lru](https://redis.io/topics/lru-cache) eviction policy.
287
293
288
294
### Can I use the same storage account for persistence across two different caches?
289
295
@@ -309,15 +315,15 @@ Yes, you can change the backup frequency for RDB persistence using the Azure por
309
315
310
316
### Why is there more than 60 minutes between backups when I have an RDB backup frequency of 60 minutes?
311
317
312
-
The RDB persistence backup frequency interval doesn't start until the previous backup process has completed successfully. If the backup frequency is 60 minutes and it takes a backup process 15 minutes to complete, the next backup won't start until 75 minutes after the start time of the previous backup.
318
+
The RDB persistence backup frequency interval doesn't start until the previous backup process completes successfully. If the backup frequency is 60 minutes and it takes a backup process 15 minutes to complete, the next backup won't start until 75 minutes after the start time of the previous backup.
313
319
314
320
### What happens to the old RDB backups when a new backup is made?
315
321
316
322
All RDB persistence backups, except for the most recent one, are automatically deleted. This deletion might not happen immediately, but older backups aren't persisted indefinitely. If you're using the Premium tier for persistence, and soft delete is turned on for your storage account, the soft delete setting applies, and existing backups continue to reside in the soft delete state.
317
323
318
324
### When should I use a second storage account?
319
325
320
-
Use a second storage account for AOF persistence when you think you've higher than expected set operations on the cache. Setting up the secondary storage account helps ensure your cache doesn't reach storage bandwidth limits. This option is only available for Premium tier caches.
326
+
Use a second storage account for AOF persistence when you think you have higher than expected set operations on the cache. Setting up the secondary storage account helps ensure your cache doesn't reach storage bandwidth limits. This option is only available for Premium tier caches.
321
327
322
328
### How can I remove the second storage account?
323
329
@@ -329,15 +335,15 @@ When the AOF file becomes large enough, a rewrite is automatically queued on the
329
335
330
336
### What should I expect when scaling a cache with AOF enabled?
331
337
332
-
If the AOF file at the time of scaling is large, then expect the scale operation to take longer than expected because it reloads the file after scaling has finished.
338
+
If the AOF file at the time of scaling is large, then expect the scale operation to take longer than expected because it reloads the file after scaling finishes.
333
339
334
340
For more information on scaling, see [What happens if I've scaled to a different size and a backup is restored that was made before the scaling operation?](#what-happens-if-ive-scaled-to-a-different-size-and-a-backup-is-restored-that-was-made-before-the-scaling-operation)
335
341
336
342
### How is my AOF data organized in storage?
337
343
338
344
When you use the Premium tier, data stored in AOF files is divided into multiple page blobs per shard. By default, half of the blobs are saved in the primary storage account and half are saved in the secondary storage account. Splitting the data across multiple page blobs and two different storage accounts increases the performance.
339
345
340
-
If the peak rate of writes to the cache isn't very high, then this extra performance might not be needed. In that case, the secondary storage account configuration can be removed. All of the AOF files are instead stored in just the single primary storage account. The following table displays how many total page blobs are used for each pricing tier:
346
+
If the peak rate of writes to the cache isn't high, then this extra performance might not be needed. In that case, the secondary storage account configuration can be removed. All of the AOF files are instead stored in just the single primary storage account. The following table displays how many total page blobs are used for each pricing tier:
341
347
342
348
| Premium tier | Blobs |
343
349
|:------------:|---------------:|
@@ -346,7 +352,7 @@ If the peak rate of writes to the cache isn't very high, then this extra perform
346
352
| P3 | 32 per shard |
347
353
| P4 | 40 per shard |
348
354
349
-
When clustering is enabled, each shard in the cache has its own set of page blobs, as indicated in the previous table. For example, a P2 cache with three shards distributes its AOF file across 48 page blobs: sixteen blobs per shard, with three shards.
355
+
When clustering is enabled, each shard in the cache has its own set of page blobs, as indicated in the previous table. For example, a P2 cache with three shards distributes its AOF file across 48 page blobs: Sixteen blobs per shard, with three shards.
350
356
351
357
After a rewrite, two sets of AOF files exist in storage. Rewrites occur in the background and append to the first set of files. Set operations, sent to the cache during the rewrite, append to the second set. A backup is temporarily stored during rewrites if there's a failure. The backup is promptly deleted after a rewrite finishes. If soft delete is turned on for your storage account, the soft delete setting applies and existing backups continue to stay in the soft delete state.
352
358
@@ -364,6 +370,10 @@ With the Premium tier, you can't use Append-only File (AOF) persistence with mul
364
370
365
371
Select the storage account that your cache is using for persistence. Select **Data Protection** from the Resource menu. In the working pane, check the state of _Enable soft delete for blobs_. For more information on soft delete in Azure storage accounts, see [Enable soft delete for blobs](/azure/storage/blobs/soft-delete-blob-enable?tabs=azure-portal).
366
372
373
+
### Can I use a storage account in a different subscription from than the one where my cache is located?
374
+
375
+
You can choose a storage account in a different subscription only, but only if you're using managed identity as the authentication method.
0 commit comments