Search code examples
c#asp.net-corecachingazure-cdnazure-redis-cache

Difference between Azure Reddis Cache and Azure CDN


I need to implement a cache in my application using Azure Cache for Reddis but I went to some blogs where I have an option to store my responses or data using Azure CDN.

Could someone suggest me what is the difference between them?

As per my understanding Reddis is used to store the cache data whereas CDN used to cache data as well as a faster response from the nearby server


Solution

  • Azure Redis Cache

    enter image description here

    It perfectly complements Azure database services such as Cosmos DB. It provides a cost-effective solution to scale read and write throughput of your data tier. Store and share database query results, session states, static contents, and more using a common cache-aside pattern.

    Here is the diagram below of Cache-Aside Pattern on Azure Storage. enter image description here

    We can see that we need to first hit to Redis Cache to see if we have our item available. if so, we will fetch it otherwise, pull the item from Table to re-cache.

    Azure CDN

    “A content delivery network (CDN) is a distributed network of edge servers that can efficiently deliver web content to users. CDNs store cached content on edge servers in point-of-presence (POP) locations that are close to end users, to minimize latency. A CDN profile, belonging to one Azure subscription, can have multiple CDN endpoints.”

    enter image description here It lets you reduce load times, save bandwidth, and speed responsiveness—whether you’re developing or managing websites or mobile apps, or encoding and distributing streaming media, gaming software, firmware updates, or IoT endpoints.

    Web-Queue-Worker on Azure App Service

    enter image description here

    Conclusion

    Azure Cache for Redis stores session state and other data that needs low latency access.
    Azure CDN is used to cache static content such as images, CSS, or HTML.