Redis Cache service has been added to Microsoft Azure, based on the most popular open source Redis Cache. It's one of the cache service offerings from Microsoft Azure allows the user to have access of rich features. Redis supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geospatial indexes. A cache created using Azure Redis Cache is accessible from any application within Microsoft Azure. Redis Cache could be used as an advanced approach of storing or caching application data that is available across distributed systems.
Why Use Redis Cache?
Redis is used by companies such as Twitter, GitHub, Stack Overflow, Snapchat, and Pinterest. Redis provides addition features like transactions, pub/sub, Lua scripting, and keys with a limited time-to-live that make it similar to traditional caches.
Following are few of the advantages of Azure Redis Cache:
- Developers can make sessions available across all the Web Servers, hosted across in a Web Farm.
- We can configure high availability and Disaster recovery for your application-specific session data.
- Redis Cache provides high performance due to the low latency and high throughput capacity of the Redis engine. To increase performance if the load on the application increases, Redis continues to remain available.
- Redis services are accessible from a variety of programming languages, such as C, C#, Java, PHP, VCL, Fancy, Io, Lua, Perl, Rust, Go, Scala, Matlab, and Python.
- Developers can leverage Redis authentication and support SSL for securing cache/client communication.
- By having primary and secondary replicas of Redis Cache, developers can make Redis Cache highly available. Microsoft Azure Redis Cache service manages it automatically. If the primary cache fails, the secondary replica is promoted to primary and a new replica is created and populated.
- Developers can monitor the health and performance of the cache, configuring alerts when a certain threshold is crossed. The process is easy and can be done through the Azure Management Portal.
Redis Cache Tiers
This service is available in two tiers in Azure currently:
- Basic: This is mainly suitable for development/test purposes and non-critical workloads. It has a single node, which is available in multiple sizes.
- Standard: This provides replication through primary and secondary nodes. It supports multiple sizes and provides a SLA of 99.9% availability.
The maximum size of the Azure Redis cache is 53 GB.
Creating a Redis Cache Service
Presently, an Azure Redis Cache can be created from the new management portal.
In the following steps, we will see how to create Azure Redis Cache.
Step 1: Log in to Azure Management Portal and select Database from Create a resource, as shown in Figure 1. Enter "Redis Cache" in the search Text box and press Enter.
Figure 1: Create New Redis service
Step 2: Click the Create button, as shown in Figure 2.
Figure 2: Search Redis and Create
Step 3: By clicking Redis Cache Create, you will be taken to the following New Redis Form, where you provide the details for creating Azure Redis Cache.
- DNS name: It's the globally unique name, the cache name in that case.
- Subscription: Your Azure Subscription, the subscription under which this new Azure Redis Cache instance will be created.
- Resource group: Name for the new resource group in which to create your Redis Cache.
- Location: Choose an Azure geographical region near to other services that will use Redis Cache.
- Pricing tier: The pricing tier determines the size, performance, and features that are available for the cache.
Click Create. That's it. We have created Azure Redis Cache service (see Figure 3).
Figure 3: Create New Redis Service
A developer can retrieve the host name, ports, and access keys by using the Azure portal.
When connecting to an Azure Redis Cache instance from code, cache clients need the host name, ports, and a key for the cache. Some clients might refer to these items by slightly different names. You can retrieve this information from the Azure portal, as shown in Figure 4.
Figure 4: Redis Service Dashboard
In this article, I have explained the basic concepts of Azure Redis Cache, different pricing tiers, and their basic features.
I hope you enjoyed reading the article. That's all for today; happy reading!