What is Azure Cache for Redis?
Mục lục bài viết
About Azure Cache for Redis
In this article
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 both the Redis open-source (OSS Redis) and a commercial product from Redis Inc. (Redis Enterprise) as a managed service. It provides secure and dedicated Redis server instances and full Redis API compatibility. The service is operated by Microsoft, 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’ve 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, it will provide a newer major release upgrade and at least one older stable version. You can choose which version 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.
Enterprise
High-performance caches powered by Redis Inc.’s Redis Enterprise software. This tier supports Redis modules including RediSearch, RedisBloom, RedisJSON, and RedisTimeSeries. Also, it offers even higher availability than the Premium tier.
Enterprise Flash
Cost-effective large caches powered by Redis Inc.’s Redis Enterprise software. This tier extends Redis data storage to nonvolatile memory, which is cheaper than DRAM, on a VM. It reduces the overall per-GB memory cost.
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:
Note
The Enterprise Flash tier currently supports only the RediSearch module (in preview) and the RedisJSON module.
Choosing the right tier
Consider the following options when choosing an Azure Cache for Redis tier:
You can scale your cache from the Basic tier up to Premium after it has been 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.
Special considerations for Enterprise tiers
The Enterprise tiers rely on Redis Enterprise, a commercial variant of Redis from Redis Inc. Customers obtain and pay for a license to this software through an Azure Marketplace offer. Azure Cache for Redis manages the license acquisition so that you won’t have to do it separately. To purchase in the Azure Marketplace, you must have the following prerequisites:
- Your Azure subscription has a valid payment instrument. Azure credits or free MSDN subscriptions aren’t supported.
- Your organization allows Azure Marketplace purchases.
- If you use a private Marketplace, it must contain the Redis Inc. Enterprise offer.
Important
Azure Cache for Redis Enterprise requires standard network Load Balancers that are charged separately from cache instances themselves. For more information, see Load Balancer pricing.
If an Enterprise cache is configured for multiple Availability Zones, data transfer is billed at the standard network bandwidth rates
starting from July 1, 2022.
In addition, data persistence adds Managed Disks. The use of these resources is free during the public preview of Enterprise data persistence. This might change when the feature becomes generally available.
Availability by region
Azure Cache for Redis is continually expanding into new regions. To check the availability by region, see Products available by region.