Azure Cache For Redis

Azure Cache For Redis


What is Redis Cache?

Redis is an open source data structure store that is used as a database or cache or message broker. Redis cache stores data as in-memory as key-value pair. It is distributed cache.

Why caching is required?

Whenever user access web application then application will fetch the data from database and display to user. Application retrieve the data from database by sending sql commands like sql queries. Database build the query and execute the commands and generate the results and send back to application. This process takes time till that time user has to wait. To reduce this time cache comes into picture.

When user request the data then application will retrieve the data from database and serve the data to user and also store data into the cache after retrieving from database. Next time when user request then application will check the data in cache if available then get the data from cache instead of database otherwise again retrieve the data from database and store into cache.

What is Azure Cache for Redis?

Azure Redis cache is cloud caching platform based on open source Redis and provides by Microsoft Azure. Application performance will increased by story frequently access application's data into in-memory storage and Azure provides access to a secure and dedicated Redis cache. Azure Redis cache stores data in-memory and that is fully managed. It supports data type as strings, hashes, lists and sets.

Why Azure cache for Redis?

Geo-Replication

By using geo-replica, two Redis cache linked together so that one will become primary cache and second one became secondary cache that will be read-only. Primary data will be replicated to secondary.

Cluster

By using Redis cluster, data will be shard(divided) across multiple Redis nodes. Each node is consist of a primary/replica cache pair for high availability.

Data persistence

Azure cache for Redis stores data into Azure storage account for data persistency so what data will be safe while underlaying infrastructure issue. RDB & AOF types of data persistency that you have to select.

  • RDB- Redis database
  • AOF- Append file only

Let's create Azure cache for Redis

Step: 1

Go to Azure portal

Azure Cache for Redis

Step: 2

Click on All resources from left side pannel.

Azure Cache for Redis

Step: 3

Go to search bar and type cache.

Azure Cache for Redis

Step: 4

After typing cache, suggestion will show option for Azure Cache for Redis. Click on that option.

Azure Cache for Redis

Step: 5

Now you came on Azure Cache for Redis page that gives you overview about Azure Cache for Redis, click on Create button.

Azure Cache for Redis

Step: 6

Now you have to fill the details to create resource like DNS Name, Subscription, Resource group, Location, Pricing tier(plan) and more(only for premium plans).

Azure Cache for Redis

Step: 7

If you selected primium plan then congigure Redis Cluster.

Azure Cache for Redis

Step: 8

If you selected primium plan then congigure Data persisence.

Azure Cache for Redis

Step: 9

If you selected primium plan then congigure Virtual Network.

Azure Cache for Redis

Step: 10

Finally click on Create button, Azure will take few moments and create Azure Cache for Redis. Click on All resource from left side pannel, you can see that Azure Cache for Redis is created and showing in grid. Azure Cache for Redis

Step: 11

Now click on Azure Cache for Redis. Now you are on overview page of Azure Cache or Redis.

Azure Cache for Redis