Azure Front door caching VS Azure CDN for blob storage - azure

This is regarding usage of Azure Front Door caching and Azure CDN. I have a Azure static website that will displaying the data (mainly office files and videos) from Azure blob storage. The files in blob storage will rarely change. I am looking for the best way and cheapest way to cache these files, so that files can be fetched quickly.
Recommendation or supporting links will be helpful.
Thanks in advance.

Caching static website content is a technique to improve user experience as well as reducing the load on webservers by offloading the delivery of static content to a dedicated cache service.
Azure CDN:
Azure CDN is globally distributed network of servers that can deliver content to the customers in a very large scale.
It is a video streaming platform where videos are delivered based on the customer’s nearest edge location.
Azure CDNs stores cached content on the edge servers which results in minimizing network latency.
Azure Front door:
It provides Scalable, secure and fast delivery of your global applications .
It enables you to define, manage, and monitor the global routing for your web traffic.
It provides best performance and instant global failover for high availability.
Based on your scenario, that best caching you can use is Azure CDN due to the following:
Azure CDN is best for delivering static content like Videos, Images and PDFs whereas Azure Front Door is for delivering sites, services and APIs.
Azure CDN is cost-effective whereas Azure Front Door charges per ruleset.
Azure CDN does all the functionality similar to Azure Front Door.
Azure CDN performs a good job at content delivery at a cheaper price!.
Update: As suggested by #silent, you can also make use of Azure Front Door Standard which is a combination of classic CDN and Front Door.
For more information, please refer below links:
https://techcommunity.microsoft.com/t5/azure-developer-community-blog/azure-on-the-cheap-azure-front-door-caching-vs-azure-cdn/ba-p/1372262
https://kishoregopalan.medium.com/azure-front-door-or-azure-cdn-what-solution-will-you-use-for-your-high-availability-sites-be26bb34aee7
https://walkingtree.tech/azure-front-door-azure-cdn-solution-will-choose/

Related

Fallback storage account (or multiple storage accounts) for Azure CDN

I can configure the Azure CDN against a single storage account presently. What I'm wondering is in the event of a disaster, where that particular region becomes unavailable (outages etc..). If I need to refresh the cache at that point I don't have any regional fallbacks. What is the correct way of supporting multiple storage accounts with the CDN?
One way that I can see it is the Traffic Manager. Traffic Manager receives the request and sends it to one of the X CDNs configured for X Storage Accounts based on performance. That way if one of the regions become unavailable, Traffic Manager should fallback to another one. This is an expensive solution though, so I'm looking for something where I can get one CDN and X Storage Accounts ideally and the CDN should handle the world-wide performance, along with a fallback region.
Here are the steps to configure AFD:
Create AFD from Portal.
Click on Front Door Designer. You will have 3 sections. First is Frontend which will be already configured. Then Baclkend Pools and Routing rules.
Click on Backend Pools and add a new backend pool. Select Storage as Host type and then pick your Primary Storage blob page and provide priority as 1.
Once that is done configure the Health probes. Then add your second Storage blob page and then provide priority as 2.
Configure Routing rules and make sure you have /* as matching pattern. Also you can enable caching in the rule and you can cache based on the query string. Moreover if have a dynamic page, then you can enable dynamic compression.
Once that is done, try accessing AFD URL and check how it works.
Here is the Public Documentation for your reference: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-routing-methods
You try using Azure FrontDoor. It is a combination of CDN and L7 load balancer. You can try implementing your ask with Azure FrontDoor.
Let me know if you face any difficulties.

Microsoft Azure cdn vs media streaming services

So, I'm working on an application where admins will be able to upload videos, for others to view on different platforms (mobile devices, computers etc). It is to be hosted on Azure, and I'm having a bit difficulty figuring out if I need to use Media services or simply a CDN.
When does it make sense to use the Media services over simply uploading to a blob and viewing through CDN? What are the advantages of using one over another?
Microsoft Azure CDN pulls content from Azure Media Services streaming server, so you could stream your content from the edge. You don't have to use a CDN if you don't need to deliver content in a large scale at a time. Rather, you could directly streaming content from streaming server offered by Azure Media Services.
The reason you maybe confused is because there are CDN vendors in the market (such as Akamai) offers streaming server capability. But by CDN itself, the edge network was just for caching the bits, not acting like a streaming server.
Cheers,
Mingfei Yan

Azure CDN vs Azure Blob storage origin pull takes way too long

I am using azure blob storage to store images in a public container and embedding them in a public website. Everything works fine, blobs are publicly available on xxxxx.blob.core.windows.net the instant i upload them. I wanted to use Azure CDN for their edge caching infrastructure and set up one at xxxxx.vo.msecnd.net.
But now, when i point my images to the CDN, it returns 404 for a good 15 mins or so, then it starts serving. It's mentioned on their documentation that we should not use CDN for high violatile or frequently changing blobs, but a simple CMS with image upload feature for a public site warrants a CDN isn't it?
I am in exactly the same situation at the moment for product images that are uploaded to my e-commerce site. I prefer to use Azure CDN on top of Azure blob storage for all of the obvious reasons but cannot wait 15 minutes for the image to be available.
For now I have resolved to store the blob storage URL initially but then later rewrite it to use the CDN domain via an Azure WebJob running once daily. It seems like an unnecessary amount of extra work but I haven't yet found a better option and really want to use the Azure CDN.
What I'm doing right now... for website related images and files I upload manually before deployment (https://abc.blob.core.windows.net/cdn) and If website User upload an image or file using my website, Internally I upload that file on blob storage (separate container not CDN) using CloudBlobClient
CDN is used for static content delivery, but in your case you need dynamic content delivery via CDN. You could use Cloud Service + CDN. This makes Dynamic contents delivered from CDN using ASP.net Caching concepts.
Please refer this link for more details: Using the Windows Azure Content Delivery Network (CDN)
CDN enables a user to fetch content from a CDN-POP that is geographically closest to the user thus allowing lower read latencies.
Without a CDN, every request would reach the origin server (in your case Azure Storage). The low latency offered by CDN is achieved when there are cache hits. On a cache miss, a CDN-POP will fetch the content from the origin server reducing the latency benefit offered by CDN. Cache hits are usually dependent on whether the content is static (results in cache hits) or dynamic (results in cache miss) and its popularity (hot objects result in cache hit).
Your choice of using a CDN or not depends on a) whether your files are static or dynamic, if dynamic then the benefit of using a CDN is lower b) whether low latency is important to your application and c) Request rate : With low number of requests your files are likely to be cached-out so a CDN may not be that useful and d) Whether you have high scalability requirements. Note, Azure storage has the following scalability limits. If your application exceeds the scalability limits of azure storage then it is recommended to use a CDN

Azure blob storage and its CDN performance?

In case one's website only targets a single geographical region, is there still benefit to serve the resource from Azure CDN instead of directly from Blob storage?
Would the CDN be better in handling high traffic condition (more parallel access to the resource)?
If you plan to grow the website or users have VPNs that could potentially alter network patterns, a CDN might be a good option. A CDN has to copy the files from blob storage and caches based on internal conventions or settings. Essentially you are adding additional instructions in front of a CDN.
Also note the Azure CDN API is pretty simple and not as robust as Akamai or other CDNs..you can compare the APIs. For example, if you want to serve the file from an in memory cache, it is probably better to have a service abstracted from it. This allows you to control how the bytes are sent down to the client explicitly..there is a huge difference in accessing small files, medium files or large files...which might provide much better performance depending on your needs.
In my opinion, I would not bother with a CDN.
A CDN (regardless of provider) won't help you that much if the edge servers are not near where your web consumers are. Will it provide better scale out of requests? Maybe. The only certainty is that it will cost you more :).
I'd recommend start off without a CDN, make your resource references easily updateable so you can switch to a CDN if need be (regardless of who provides the CDN service).

Is there a charge between Azure CDN and hosted application in same data center?

I know "There is no charge on bandwidth between Azure storage and applications hosted in the same data center."
And there has 5000 requests/second limit, and Microsoft suggest use CDN to overcome the limits.
So, I like to know "Is there a charge on bandwidth between Azure CDN and hosted application in same data center?"
Think of the CDN as about 2 dozen non-datacenter entities (nodes?). Any time a CDN node is loaded with a requested object, you're paying for egress from blob storage, along with the associated transaction(s) against storage, required to transfer said object to that CDN node. There's no concept of CDN being in the same data center as your hosted app.
Looking at the full picture:
There's egress cost + transaction(s) for each object loaded into each CDN node (and there's no way to decide how few or how many nodes are loaded; this is based on whichever CDN node a client app ends up hitting, based on various networking rules)
There's egress cost + transaction(s) for each object transfered from a CDN node to a client application.
There are no CDN nodes considered "inside a Windows Azure data center" - each node has a load cost associated with it.
Full pricing details are here.

Resources