What is Azure Cache for Redis?
Azure Cache for Redis provides an in-memory data store based on the Redis software. Redis improves the performance and scalability of an application that uses backend data stores heavily. It's able to process large volumes of application requests by keeping frequently accessed data in the server memory, which can be written to and read from quickly. Redis brings a critical low-latency and high-throughput data storage solution to modern applications.
Azure Cache for Redis offers the Redis open-source (OSS Redis) as a managed service. It provides secure and dedicated Redis server instances and full Redis API compatibility. Microsoft operates the service, hosted on Azure, and usable by any application within or outside of Azure.
Azure Cache for Redis can be used as a distributed data or content cache, a session store, a message broker, and more. It can be deployed standalone. Or, it can be deployed along with other Azure database services, such as Azure SQL or Azure Cosmos DB.
Key scenarios
Azure Cache for Redis improves application performance by supporting common application architecture patterns. Some of the most common include the following patterns:
Pattern | Description |
---|---|
Data cache | Databases are often too large to load directly into a cache. It's common to use the cache-aside pattern to load data into the cache only as needed. When the system makes changes to the data, the system can also update the cache, which is then distributed to other clients. Additionally, the system can set an expiration on data, or use an eviction policy to trigger data updates into the cache. |
Content cache | Many web pages are generated from templates that use static content such as headers, footers, banners. These static items shouldn't change often. Using an in-memory cache provides quick access to static content compared to backend datastores. This pattern reduces processing time and server load, allowing web servers to be more responsive. It can allow you to reduce the number of servers needed to handle loads. Azure Cache for Redis provides the Redis Output Cache Provider to support this pattern with ASP.NET. |
Session store | This pattern is commonly used with shopping carts and other user history data that a web application might associate with user cookies. Storing too much in a cookie can have a negative effect on performance as the cookie size grows and is passed and validated with every request. A typical solution uses the cookie as a key to query the data in a database. When you use an in-memory cache, like Azure Cache for Redis, to associate information with a user is faster than interacting with a full relational database. |
Job and message queuing | Applications often add tasks to a queue when the operations associated with the request take time to execute. Longer running operations are queued to be processed in sequence, often by another server. This method of deferring work is called task queuing. Azure Cache for Redis provides a distributed queue to enable this pattern in your application. |
Distributed transactions | Applications sometimes require a series of commands against a backend data-store to execute as a single atomic operation. All commands must succeed, or all must be rolled back to the initial state. Azure Cache for Redis supports executing a batch of commands as a single transaction. |
Redis versions
Azure Cache for Redis supports OSS Redis version 4.0.x and 6.0.x. We made the decision to skip Redis 5.0 to bring you the latest version. Previously, Azure Cache for Redis maintained a single Redis version. In the future, you can choose from a newer major release upgrade and at least one older stable version. You can choose the version that works the best for your application.
Service tiers
Azure Cache for Redis is available in these tiers:
Tier | Description |
---|---|
Basic | An OSS Redis cache running on a single VM. This tier has no service-level agreement (SLA) and is ideal for development/test and noncritical workloads. |
Standard | An OSS Redis cache running on two VMs in a replicated configuration. |
Premium | High-performance OSS Redis caches. This tier offers higher throughput, lower latency, better availability, and more features. Premium caches are deployed on more powerful VMs compared to the VMs for Basic or Standard caches. |
Feature comparison
The Azure Cache for Redis Pricing provides a detailed comparison of each tier. The following table helps describe some of the features supported by tier:
Feature Description | Basic | Standard | Premium |
---|---|---|---|
Service Level Agreement (SLA) | No | Yes | Yes |
Data encryption in transit | Yes | Yes | Yes |
Network isolation | Yes | Yes | Yes |
Scaling | Yes | Yes | Yes |
OSS clustering | No | No | Yes |
Data persistence | No | No | Yes |
Zone redundancy | No | Preview | Preview |
Geo-replication | No | No | Yes (Passive) |
Connection audit logs | No | No | Yes (Poll-based) |
Redis Modules | No | No | No |
Import/Export | No | No | Yes |
Reboot | Yes | Yes | Yes |
Update channel and Schedule updates | Yes | Yes | Yes |
Choosing the right tier
Consider the following options when choosing an Azure Cache for Redis tier:
- Memory: The Basic and Standard tiers offer 250 MB - 53 GB; the Premium tier 6 GB - 1.2 TB; To create larger sized cache instances, you can use scale out. For more information, see Azure Cache for Redis Pricing.
- Performance: Caches in the Premium tiers are deployed on hardware that has faster processors, giving better performance compared to the Basic or Standard tier. For more information, see Performance testing.
- Dedicated core for Redis server: All caches except C0 run dedicated vCPUs. The Basic, Standard, and Premium tiers run open source Redis, which by design uses only one thread for command processing. On these tiers, having more vCPUs usually improves throughput performance because Azure Cache for Redis uses other vCPUs for I/O processing or for OS processes. However, adding more vCPUs per instance might not produce linear performance increases. Scaling out usually boosts performance more than scaling up in these tiers.
- Network performance: If you have a workload that requires high throughput, the Premium tier offers more bandwidth compared to Basic or Standard. Also within each tier, larger size caches have more bandwidth because of the underlying VM that hosts the cache. Higher bandwidth limits help you avoid network saturation that cause timeouts in your application.For more information, see Performance testing.
- Maximum number of client connections: The Premium tiers offer the maximum numbers of clients that can connect to Redis, offering higher numbers of connections for larger sized caches. Clustering increases the total amount of network bandwidth available for a clustered cache.
- High availability: Azure Cache for Redis provides multiple high availability options. It guarantees that a Standard, Premium cache is available according to our SLA. The SLA only covers connectivity to the cache endpoints. The SLA doesn't cover protection from data loss. We recommend using the Redis data persistence feature in the Premium tiers to increase resiliency against data loss.
- Data persistence: The Premium tiers allow you to persist the cache data to an Azure Storage account and a Managed Disk respectively. Underlying infrastructure issues might result in potential data loss. We recommend using the Redis data persistence feature in these tiers to increase resiliency against data loss. Azure Cache for Redis offers both RDB and AOF (preview) options. Data persistence can be enabled through Azure portal and CLI. For the Premium tier, see How to configure persistence for a Premium Azure Cache for Redis.
- Network isolation: Azure Private Link and Virtual Network (VNet) deployments provide enhanced security and traffic isolation for your Azure Cache for Redis. VNet allows you to further restrict access through network access control policies. For more information, see Azure Cache for Redis with Azure Private Link and How to configure Virtual Network support for a Premium Azure Cache for Redis.
You can scale your cache from the Basic tier up to Premium after it is created. Scaling down to a lower tier isn't supported currently. For step-by-step scaling instructions, see How to Scale Azure Cache for Redis and How to scale - Basic, Standard, and Premium tiers.
Availability by region
Azure Cache for Redis is continually expanding into new regions. To check the availability by region, see Products available by region.