3

If using a CDN in Azure in relation to a website/webapp (i.e an Azure application service), what are the benefits/drawbacks of using blob storage vs just using the web application as the endpoint?

For example, a simple CMS website stores all uploaded images in /uploads/myimage.jpg

Using the CDN I could set its endpoint at mywebsite.com/uploads/ or I could create a blob container, set the CMS to store the images there and set it as the origin for the CDN.

What are my considerations for choosing one over the other?

DannyT
  • 628
  • 1
  • 8
  • 22

2 Answers2

4

As Rob stated in his answer, there's not much difference, performance-wise. Here are what I consider the core differences, overall, between web app-backed CDN and blob-backed CDN:

  • With first-hit of an object (or the hit after the cache has expired), Web App-backed CDN will have that traffic route through your web app initially. If it is a very large resource (e.g. video file), it's possible that you'll notice an intermittent performance drop due to bandwidth being consumed in an unusually-high manner (until this object is cached in CDN). Blob storage doesn't have the same type of bandwidth limits.
  • with Web App-backed CDN, you have to remember that your storage is limited by the Web App tier you've chosen. If you have 10's of GB of assets, for example, this could force you into a higher tier. With Blob storage, you'll have 500TB of total durable storage, with objects sizeable up to 4.77TB.
  • Web Web App-backed CDN, the storage residing in your web app is durable, just like blob storage, until you delete your Web App. Then that storage is gone. With Blob storage, your storage would remain, even after deleting a Web App (or an entire App Service). Of course, your objects would disappear if you deleted the Storage Account...
  • If you have assets that are needed in multiple web apps (or other apps hosted elsewhere), you will start to have links from one app, pointing to the assets of another app, introducing a dependency (e.g. web app A with css links to content in web app B). You'd need to carefully manage that. Or store common assets in blob storage and avoid app-to-app linkage dependencies.
  • Blob storage would give you the option of locating your static assets in a different region than your web app. With web app storage, they'd always be colocated. (I'm not advocating separating content across regions; just pointing out the flexibility to do so).
  • Content management for Blob storage can be done in many ways: Direct REST API calls, SDK-based calls, and many 1st- and 3rd-party tools. With Web App content, there are no such APIs and tools; you'd either have to deploy assets along with your code, or copy content from another source (e.g. blob storage) upon startup (or manually, or via scripts, or however else you choose).
David Makogon
  • 69,407
  • 21
  • 141
  • 189
3

If I understand your question, you're asking about the benefits and drawbacks of two different scenarios:

  1. Using an Azure CDN that's backed by Azure Blob Storage.
  2. Using an Azure CDN that hits the underlying Web App directly.

Honestly, there's not a huge difference between the two. When a request is made to your CDN for an asset, Azure will retrieve the content, cache it, and serve it. So once your CDN's cache is loaded, there's no difference between the two scenarios.

If your cache expiration headers are for a very short period of time and you're dealing with very large files and lots of requests, using Blob storage for the initial loading would be a better option to take load off of your Web App.

I'd probably start with whatever is easiest to implement for your solution and only tune if you run into problems.

Rob Reagan
  • 7,313
  • 3
  • 20
  • 49
  • You do understand my question thank you. I was curious if there were any cost considerations such as storage space, bandwidth costs etc. I've also seen references to longevity and assurance of data (e.g. web app data can be wiped?). But couldn't find anything concrete on that. – DannyT Dec 13 '17 at 18:01
  • Excellent. You'd have to be pushing some MAJOR traffic for big files to have this implementation detail really matter. But kudos on thinking ahead. – Rob Reagan Dec 13 '17 at 18:02
  • 1
    Sorry I expanded on my comment after hitting return for a new line :/. I'll leave this question open for a short while in case there are other points but otherwise will accept your answer tomorrow :) – DannyT Dec 13 '17 at 18:04
  • @DannyT, Web App files are actually backed by Azure Storage. The only way I know of wiping out Web App files is by either explicitly deleting them, or by accidentally checking the "Remove additional files at destination" when publishing. That one hurts, ask me how I know. :-) You can geo-replicate with Blob storage for that extra peace of mind. – Rob Reagan Dec 13 '17 at 18:07