Azure Redis Cache is a cache service by Microsoft that uses Redis, an open-source in-memory data structure store. It provides caching that can increase performance and availability by temporarily copying frequently accessed data to fast storage close to applications. Redis can be used as a database, cache, and message broker. Azure Redis Cache handles authentication, SSL, monitoring, alerts and integrates with the Azure ecosystem. It allows caching without persistence, but Redis also supports append-only files and snapshots for data persistence. The document outlines how to connect to Azure Redis Cache from an application and consider patterns like cache-aside for unpredictable workloads. It also discusses cache invalidation, scaling Redis, and troubleshooting issues like missing keys.
3. Caching
• Temporarily copying frequently accessed data to fast storage that's
located closeto the application.
• Use for Increase performanceand Increase availability.
4. What is Redis ?
• Redis is an open-source in-memorydata structure project implementing a
distributed, in-memory key-value database with optional
durability which used as a database, cacheand message broker
• REDIS=REmote Dictonary Server
6. In Memory = No Persistence
• AOF (Append only Files)
• RDB (Redis DB Snapshots)
7. Establishing connection with Azure Redis
• Step 1: Install-Package StackExchange.Redis
• Step 2: Set connection string
• Step 3: ConnectionMultiplexer class should be shared & resued & laze loaded.
8. Establishing connection with Azure Redis
• Step 4: Call the GetDatabase() of Connection property.
• Step 5 : Use Json.Net serializer for complex object.
9. Pattern to Consider
Use this pattern if :
a. Cache doesn't provide native read-
through and write-through operations.
b. Resource demand is unpredictable.
c. Read heavy workload.
DONT USE if:
a) Cached data set is static.
b) Caching session state information in a
web application hosted in a web farm
11. What happened to my data?
• Some of my keys have disappeared !
• Expiration [ SET, PSETX, EXPIRE]
• Eviction [LRU cache rule]
• Key Deletion [DEL, HDEL]
• Async Replication
• Most or All my keys are gone !!
• Single Node Configuration [example: Azure Basic Tier]
• Flush [FLUSHDB, FLUSHALL]
• Multi-node failure
16. Microsoft Azure Bangladesh
group: www.facebook.com/groups/microsoft.azure.bd
fan page: fb.com/microsoft.azure.bd
Asp.Net - Bangladesh
www.facebook.com/groups/asp.net.mvc.bd
Community Group