Search code examples
azurecdn

Understanding Azure CDN


I am new to Azure CDN. Basically, I am trying to use CDN for my php website images, javascript files and css files.

I have created an Azure blob storage, then I added one container and started adding file to that container. I noticed that each file is accessible via a url something like this https://*******.blob.core.windows.net/content/Test1.jpg

Thats it!. I guess that is what I wanted. But, now question is; where CDN comes to play? I see that we can create a CDN and then add endpoint to that CDN that will further point to Blob Storage that I have created earlier. But, question is, why I would need to create that CDN and its end point while I am already able to access my file thru url that is provided by Azure Storage?


Solution

  • CDN and cloud storage like Azure blob storage are two different things. A CDN can be defined as:

    A content delivery network or content distribution network is a geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and high performance by distributing the service spatially relative to end-users.

    Where as cloud storage services provides highly available and secure storage space over the cloud. Azure blob storage provides you with the storage capabilities but doesn't provides a way to better deliver content to the user.

    With Azure CDN, you can cache static objects loaded from Azure Blob storage, a web application, or any publicly accessible web server, by using the closest point of presence (POP) server. Azure CDN can also accelerate dynamic content, which cannot be cached, by leveraging various network and routing optimizations.

    Whenever a request comes, the Azure CDN will determine the nearest point of presence server and will serve the content from there and not the actual server.

    This will result in

    • improved page load times
    • reduced original server bandwidth
    • Large scaling to better handle instantaneous high loads.

    why I would need to create that CDN and its end point while I am already able to access my file thru url that is provided by Azure Storage?

    The CDN is useful especially

    • if your traffic is from across the globe and from different locations.

    • if you want faster delivery of content to your user.

    • if you want to reduce the server bandwidth on the original server.

    So, Although its a good practice to deploy CDN, however you might be able to use blob storage as well. But, you may encounter higher latency when fulfilling requests from far locations and may face performance issues and problems related to bandwidth, when your site traffic is significant from different locations or when there are sudden a spikes in the load. There CDN comes to your rescue, otherwise for a normal website with low to moderate traffic from nearby proximity, it's quite normal if you don't use CDNs as usage of CDN will incur additional cost.