-
Notifications
You must be signed in to change notification settings - Fork 21.8k
Expand file tree
/
Copy pathdevelopment-faq.yml
More file actions
122 lines (97 loc) · 8.44 KB
/
development-faq.yml
File metadata and controls
122 lines (97 loc) · 8.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
### YamlMime:FAQ
metadata:
title: Azure Managed Redis development FAQs
description: Learn the answers to common questions that help you develop for Azure Managed Redis.
ms.date: 05/18/2025
ms.topic: faq
ms.custom:
- devx-track-csharp
- ignite-2024
- build-2025
ms.devlang: csharp
appliesto:
- ✅ Azure Managed Redis
title: Azure Managed Redis development FAQs
summary: This article provides answers to common questions about how to develop for Azure Managed Redis.
sections:
- name: Ignored
questions:
- question: |
How can I get started with Azure Managed Redis?
answer: |
There are several ways you can get started with Azure Managed Redis.
* You can check out one of our tutorials available for [.NET](dotnet.md), [Java](java-get-started.md), [Node.js](nodejs-get-started.md), and [Python](python-get-started.md).
* You can explore [Azure Redis learning paths](https://learn.microsoft.com/training/browse/?expanded=azure&products=azure-cache-redis)
* You can check out the client documentation for the example clients that match the development language you use in your project. There are many Redis clients that can be used with Azure Managed Redis. For a list of Redis clients, see [https://redis.io/clients](https://redis.io/clients).
If you don't already have an Azure account, you can:
* [Open an Azure account for free](https://azure.microsoft.com/pricing/free-trial/?WT.mc_id=redis_cache_hero). You get credits that can be used to try out paid Azure services. Even after the credits are used up, you can keep the account and use free Azure services and features.
* [Activate Visual Studio subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/?WT.mc_id=redis_cache_hero). Your MSDN subscription gives you credits every month that you can use for paid Azure services.
- question: |
What do the StackExchange.Redis configuration options do?
answer: |
StackExchange.Redis has many options. This section talks about some of the common settings. For more detailed information about StackExchange.Redis options, see [StackExchange.Redis configuration](https://stackexchange.github.io/StackExchange.Redis/Configuration).
| ConfigurationOptions | Description | Recommendation |
| --- | --- | --- |
| AbortOnConnectFail |When set to true, the connection can't reconnect after a network failure. |Set to false and let StackExchange.Redis reconnect automatically. |
| ConnectRetry |The number of times to repeat connection attempts during initial connect. |See the following notes for guidance. |
| ConnectTimeout |Timeout in ms for connect operations. |See the following notes for guidance. |
Usually the default values of the client are sufficient. You can fine-tune the options based on your workload.
### Retries
* For ConnectRetry and ConnectTimeout, the general guidance is to fail fast and retry again. This guidance is based on your workload and how much time---on average---it takes for your client to issue a Redis command and receive a response.
* Let StackExchange.Redis automatically reconnect instead of checking connection status and reconnecting yourself. **Avoid using the ConnectionMultiplexer.IsConnected property**.
* Snowballing - you might run into an issue where you're retrying and the retries snowball and never recover. If snowballing occurs, consider using an exponential backoff retry algorithm as described in [Retry general guidance](/azure/architecture/best-practices/transient-faults) published by the Microsoft Patterns & Practices group.
### Timeout values
* Consider your workload and set the values to match. If you're storing large values, set the timeout to a higher value.
* Set `AbortOnConnectFail` to false and let StackExchange.Redis reconnect for you.
* Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request.
* Set the `ConnectionMultiplexer.ClientName` property to an app instance unique name for diagnostic purposes.
* Use multiple `ConnectionMultiplexer` instances for custom workloads.
* You can follow this model if you have varying load in your application. For example:
* You can have one multiplexer for dealing with large keys.
* You can have one multiplexer for dealing with small keys.
* You can set different values for connection timeouts and retry logic for each ConnectionMultiplexer that you use.
* Set the `ClientName` property on each multiplexer to help with diagnostics.
* This guidance might lead to more streamlined latency per `ConnectionMultiplexer`.
- question: |
What Redis clients can I use?
answer: |
One of the great things about Redis is that there are many clients supporting many different development languages. For a current list of clients, see [Redis clients](https://redis.io/docs/latest/operate/rs/databases/connect/supported-clients-browsers/).
- question: |
Is there a local emulator for Azure Managed Redis?
answer: |
There's no local emulator for Azure Managed Redis. You can, however, run a copy of community Redis on your local machine and connect to it to get a similar experience to a local cache emulator, as shown in the following example:
```csharp
private static Lazy<ConnectionMultiplexer>
lazyConnection = new Lazy<ConnectionMultiplexer> (() =>
{
// Connect to a locally running instance of Redis to simulate
// a local cache emulator experience.
return ConnectionMultiplexer.Connect("127.0.0.1:6379");
});
public static ConnectionMultiplexer Connection
{
get
{
return lazyConnection.Value;
}
}
```
Redis runs natively on Linux, but you can also use Windows Subsystem for Linux to run Redis on a windows machine. For more information, see [Install Redis on Windows](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/)
- question: |
How can I run Redis commands?
answer: |
You can use any of the commands listed at [Redis commands](https://redis.io/commands#) except for the commands listed at [Redis commands not supported in Azure Managed Redis](configure.md#redis-commands-not-supported-in-azure-managed-redis). You have several options to run Redis commands.
You can also use the Redis command-line tools. To use them, see [Use the Redis command-line tool with Azure Managed Redis](how-to-redis-cli-tool.md)
- question: |
Why doesn't Azure Managed Redis have an MSDN class library reference?
answer: |
Microsoft Azure Managed Redis is based on the popular in-memory data store, Redis. You can use a wide variety of [Redis clients](https://redis.io/docs/latest/operate/rs/databases/connect/supported-clients-browsers/) for many programming languages. Each client has its own API that makes calls to the Azure Managed Redis instance using [Redis commands](https://redis.io/commands).
Because each client is different, you can't find one centralized class reference on MSDN. Each client maintains its own reference documentation. Besides the reference documentation, there are several tutorials showing how to get started with Azure Managed Redis using different languages and cache clients.
- question: |
What are Redis databases?
answer: |
Redis Databases are just a logical separation of data within the same Redis instance. The cache memory is shared between all the databases and actual memory consumption of a given database depends on the keys/values stored in that database.
Right now, Azure Managed Redis only supports one database per instance.
additionalContent: |
## Related content
Learn about other [Azure Managed Redis FAQs](faq.yml).