Skip to content

Commit 60dd382

Browse files
committed
drafts
1 parent 75394e4 commit 60dd382

File tree

3 files changed

+116
-123
lines changed

3 files changed

+116
-123
lines changed
Lines changed: 69 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Best practices for client libraries
3-
description: Learn about recommended client libraries for Azure Cache for Redis.
3+
description: Learn about recommended client libraries for Azure Cache for Redis, including a section devoted to Redisson best practices.
44

55

66
ms.topic: conceptual
@@ -12,84 +12,41 @@ ms.custom: devx-track-java, devx-track-javaee, devx-track-javaee-liberty, devx-t
1212

1313
# Client libraries
1414

15-
Azure Cache for Redis is based on the popular open-source in-memory data store, open-source Redis. Redis clients for many programming languages can access Azure Managed Redis. Each client library has its own API that makes calls to Redis server using Redis commands, but the client libraries are built to talk to any Redis server.
15+
Azure Cache for Redis is based on the open-source, in-memory data store Redis. Redis clients for many programming languages can access Azure Redis. Your application can use any client library that's compatible with open-source Redis to connect to your Azure Redis cache.
1616

17-
Each client maintains its own reference documentation for its library. The clients also provide links to get support through the client library developer community. The Azure Cache for Redis team doesn't own the development, or the support for any client libraries.
17+
Each client library has its own API that calls Redis servers using Redis commands. The client libraries are built to communicate with any Redis server.
1818

19-
Although we don't own or support any client libraries, we do recommend some libraries. Recommendations are based on popularity and whether there's an active online community to support and answer your questions. We only recommend using the latest available version, and upgrading regularly as new versions become available. These libraries are under active development and often release new versions with improvements to reliability and performance.
19+
Each client maintains reference documentation for its own library, and provides links to get support through the client library developer community. Microsoft and the Azure Redis team don't own the development or support for any client libraries.
2020

21-
| **Client library** | **Language** | **GitHub** **repo** | **Documentation**|
21+
Microsoft and Azure Redis do recommend some libraries, based on popularity and whether there's an active online support community to answer questions. These libraries are under active development and often release new versions with reliability and performance improvements. Microsoft recommends using the latest available version, and upgrading regularly as new versions become available.
22+
23+
| **Client library** | **Language** | **GitHub repo** | **Documentation**|
2224
| --------------------|------------- |-------------------------------------------------------| --------------------------|
23-
| StackExchange.Redis | C#/.NET | [Link](https://github.com/StackExchange/StackExchange.Redis)| [More information here](https://stackexchange.github.io/StackExchange.Redis/) |
24-
| Lettuce | Java | [Link](https://github.com/lettuce-io/) | [More information here](https://lettuce.io/) |
25-
| Jedis | Java | [Link](https://github.com/redis/jedis) | |
26-
| node_redis | Node.js | [Link](https://github.com/redis/node-redis) | |
27-
| Redisson | Java | [Link](https://github.com/redisson/redisson) | [More information here](https://redisson.org/) |
28-
| ioredis | Node.js | [Link](https://github.com/luin/ioredis) | [More information here](https://ioredis.readthedocs.io/en/stable/API/) |
25+
| StackExchange.Redis | C#/.NET | [https://github.com/StackExchange/StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis)| [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) |
26+
| Jedis | Java | [https://github.com/redis/jedis](https://github.com/redis/jedis) | |
27+
| Lettuce | Java | [https://github.com/lettuce-io/](https://github.com/lettuce-io/) | [Lettuce - Advanced Java Redis client](https://lettuce.io/) |
28+
| Redisson | Java | [https://github.com/redisson/redisson](https://github.com/redisson/redisson) | [Redisson - Redis Java client Real-Time Data Platform](https://redisson.pro/docs/) |
29+
| ioredis | Node.js | [https://github.com/luin/ioredis](https://github.com/luin/ioredis) | [Classes](https://ioredis.readthedocs.io/en/stable/API/) |
30+
| node_redis | Node.js | [https://github.com/redis/node-redis](https://github.com/redis/node-redis) | |
2931

3032
> [!NOTE]
31-
> Your application can use any client library that is compatible with open-source Redis to connect to your Azure Cache for Redis instance.
33+
> Your application can use any client library that's compatible with open-source Redis to connect to your Azure Redis instance.
3234
3335
## Client library-specific guidance
3436

35-
For information on client library-specific guidance best practices, see the following links:
37+
For client library-specific guidance and best practices, see the following links:
3638

3739
- [StackExchange.Redis (.NET)](cache-best-practices-connection.md#using-forcereconnect-with-stackexchangeredis)
38-
- [Lettuce (Java)](https://github.com/Azure/AzureCacheForRedis/blob/main/Lettuce%20Best%20Practices.md)
40+
- [HiRedisCluster](https://github.com/Azure/AzureCacheForRedis/blob/main/HiRedisCluster%20Best%20Practices.md)
3941
- [Jedis (Java)](https://github.com/Azure/AzureCacheForRedis/blob/main/Redis-BestPractices-Java-Jedis.md)
40-
- [Redisson (Java)](cache-best-practices-client-libraries.md#redisson-java)
42+
- [Lettuce (Java)](https://github.com/Azure/AzureCacheForRedis/blob/main/Lettuce%20Best%20Practices.md)
4143
- [Node.js](https://github.com/Azure/AzureCacheForRedis/blob/main/Redis-BestPractices-Node-js.md)
4244
- [PHP](https://github.com/Azure/AzureCacheForRedis/blob/main/Redis-BestPractices-PHP.md)
43-
- [HiRedisCluster](https://github.com/Azure/AzureCacheForRedis/blob/main/HiRedisCluster%20Best%20Practices.md)
44-
45-
## Redisson (Java)
46-
47-
We _recommend_ you use redisson 3.14.1 or higher. Older versions contain known connection leak issues that cause problems after failovers. Monitor the Redisson changelog for other known issues can affect features used by your application. For more information, see[`CHANGELOG`](https://github.com/redisson/redisson/blob/master/CHANGELOG.md) and the [Redisson FAQ](https://github.com/redisson/redisson/wiki/16.-FAQ).
48-
49-
Other notes:
50-
51-
- Redisson defaults to 'read from replica' strategy, unlike some other clients. To change this default, modify the 'readMode' config setting.
52-
- Redisson has a connection pooling strategy with configurable minimum and maximum settings, and the default minimum values are large. The large defaults could contribute to aggressive reconnect behaviors or 'connection storms.' To reduce the risk, consider using fewer connections because you can efficiently pipeline commands, or batches of commands, over a few connections.
53-
- Redisson has a default idle connection time out of 10 seconds, which leads to more closing and reopening of connections than ideal.
54-
55-
Here's a recommended baseline configuration for cluster mode that you can modify as needed:
56-
57-
```yml
58-
clusterServersConfig:
59-
idleConnectionTimeout: 30000
60-
connectTimeout: 15000
61-
timeout: 5000
62-
retryAttempts: 3
63-
retryInterval: 3000
64-
checkLockSyncedSlaves: false
65-
failedSlaveReconnectionInterval: 15000
66-
failedSlaveCheckInterval: 60000
67-
subscriptionsPerConnection: 5
68-
clientName: "redisson"
69-
loadBalancer: !<org.redisson.connection.balancer.RoundRobinLoadBalancer> {}
70-
subscriptionConnectionMinimumIdleSize: 1
71-
subscriptionConnectionPoolSize: 50
72-
slaveConnectionMinimumIdleSize: 2
73-
slaveConnectionPoolSize: 24
74-
masterConnectionMinimumIdleSize: 2
75-
masterConnectionPoolSize: 24
76-
readMode: "MASTER"
77-
subscriptionMode: "MASTER"
78-
nodeAddresses:
79-
- "redis://mycacheaddress:6380"
80-
scanInterval: 1000
81-
pingConnectionInterval: 60000
82-
keepAlive: false
83-
tcpNoDelay: true
84-
```
85-
86-
For an article about Redisson's support for JCache as the store for HTTP session state in IBM Liberty on Azure, see [Use Java EE JCache with Open Liberty or WebSphere Liberty on an Azure Kubernetes Service (AKS) cluster](/azure/developer/java/ee/how-to-deploy-java-liberty-jcache).
45+
- [Redisson (Java)](cache-best-practices-client-libraries.md#best-practices-for-redisson-java)
8746

8847
## How to use client libraries
8948

90-
Besides the reference documentation, you can find tutorials showing how to get started with Azure Cache for Redis using different languages and cache clients.
91-
92-
For more information on using some of these client libraries in tutorials, see the following articles:
49+
Besides the reference documentation, you can use the following tutorials to get started with Azure Redis using different languages and cache clients:
9350

9451
- [Code a .NET Framework app](../redis/dotnet-how-to-use-azure-redis-cache.md)
9552
- [Code a .NET Core app](../redis/dotnet-core-quickstart.md)
@@ -99,7 +56,56 @@ For more information on using some of these client libraries in tutorials, see
9956
- [Code a Node.js app](../redis/nodejs-get-started.md)
10057
- [Code a Python app](../redis/python-get-started.md)
10158

102-
## Next steps
59+
## Best practices for Redisson (Java)
60+
61+
Here are some recommended best practices for Redisson:
62+
63+
- Use Redisson 3.14.1 or higher. Older versions contain known connection leak issues that cause problems after failovers.
64+
65+
- Monitor the Redisson changelog for known issues that can affect features your application uses. For more information, see[`CHANGELOG`](https://github.com/redisson/redisson/blob/master/CHANGELOG.md) and the [Redisson FAQ](https://github.com/redisson/redisson/wiki/16.-FAQ).
66+
67+
- If you don't want to use the *read from replica* strategy, modify the `readMode` config setting. Unlike some other clients, Redisson uses *read from replica* as the default.
68+
69+
- To reduce the risk of aggressive reconnect behaviors or *connection storms*, consider setting fewer minimum connections.
70+
71+
Redisson has a connection pooling strategy with configurable minimum and maximum settings, and the default minimum values are large. The large defaults could contribute to aggressive reconnect behaviors or connection storms. To reduce this risk, consider using fewer connections. You can efficiently pipeline commands or batches of commands over a few connections.
72+
73+
- Reset the idle connection timeout if necessary. Redisson has a default 10 second idle connection timeout, which can lead to more closing and reopening of connections than ideal.
74+
75+
- For an article about Redisson's support for JCache as the store for HTTP session state in IBM Liberty on Azure, see [Use Java EE JCache with Open Liberty or WebSphere Liberty on an Azure Kubernetes Service (AKS) cluster](/azure/developer/java/ee/how-to-deploy-java-liberty-jcache).
76+
77+
- Use the following recommended baseline configuration for cluster mode, and modify it as needed.
78+
79+
```yml
80+
clusterServersConfig:
81+
idleConnectionTimeout: 30000
82+
connectTimeout: 15000
83+
timeout: 5000
84+
retryAttempts: 3
85+
retryInterval: 3000
86+
checkLockSyncedSlaves: false
87+
failedSlaveReconnectionInterval: 15000
88+
failedSlaveCheckInterval: 60000
89+
subscriptionsPerConnection: 5
90+
clientName: "redisson"
91+
loadBalancer: !<org.redisson.connection.balancer.RoundRobinLoadBalancer> {}
92+
subscriptionConnectionMinimumIdleSize: 1
93+
subscriptionConnectionPoolSize: 50
94+
slaveConnectionMinimumIdleSize: 2
95+
slaveConnectionPoolSize: 24
96+
masterConnectionMinimumIdleSize: 2
97+
masterConnectionPoolSize: 24
98+
readMode: "MASTER"
99+
subscriptionMode: "MASTER"
100+
nodeAddresses:
101+
- "redis://mycacheaddress:6380"
102+
scanInterval: 1000
103+
pingConnectionInterval: 60000
104+
keepAlive: false
105+
tcpNoDelay: true
106+
```
107+
108+
## Related content
103109
104110
- [Azure Cache for Redis development FAQs](cache-development-faq.yml)
105111
- [Best practices for development](cache-best-practices-development.md)

0 commit comments

Comments
 (0)