5

i know that CDN is just for static contents. but then i still have to spread out by apache servers to all corners of the world right? so when i have done it, why dont i just set up some dedicated apache servers in place only serving static content just like CDN?

are there real benefits from still using CDN compared to that scenario?

ajsie
  • 1,215
  • 4
  • 20
  • 28

2 Answers2

8

A CDN is used for any content that is going to be accessed a multitude of times in a lot of various locations. YouTube for example, uses a CDN.

The main advantage of a CDN is that you have a local Point of Presence for the majority of your internet users. If you notice that you're getting a lot of traffic from North America and England and Brazil, there's no way that all of them are getting an optimum experience, because if your servers are located in New Zealand, then they're all going to access at different speeds.

By putting your servers in the countries where you get the majority of your traffic from, and then directing the user to their closest server, you're eliminating a lot of potential bottlenecks.

Simply having "some dedicated servers only serving static content" does not alleviate this issue, as all your servers are going to be in the same place. If you're going to spread your servers out around the world, then your two scenarios are the same.

All that said, I would never bother to build my own CDN unless I was someone the size of YouTube or Facebook. There are a few providers out there who already have a massive, robust network that you can use. See the following ServerFault questions for more information:

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
  • hmm i think u've misunderstood me. cause i was assuming in my question that I already have spread the apache servers to different locations of the world. cause CDN is just delivering static content and i still have to distribute my apache servers in different corners of the world, so in that scenario, why dont i just set up additional apache servers for serving only static content and ditch the CDN? what are the pros and cons at that time with CDN compared to my dedicated apache servers? – ajsie Apr 05 '10 at 21:54
  • If you set up servers all around the world, all serving content, then that IS a CDN (a basic one, but still a CDN). Are you talking about a hosted CDN (like Edgecast) vs your own CDN? I'm not sure I understand your question. – Mark Henderson Apr 05 '10 at 21:56
  • yes you could say that: hosted CDN my own CDN (since i already have dynamic content apache servers on different locations i might as well put up static content apache servers). in that scenario, which is to prefer? costs? interaction with my dynamical ones etc? – ajsie Apr 05 '10 at 22:57
  • please check my other comment too below. – ajsie Apr 05 '10 at 23:08
  • Simply typical CDN providers have usually at least +200 dedicated servers around the globe... So imagine you have to manage 200 physical locations, even if you decided to create the CDN virtually i.e. using cloud providers service, it would cost a lot and need a lot of effort for maintaining hundreds of virtual machines. Add to that the cost, especially relative to the expected traffic. – Ghassan Maslamani Mar 08 '21 at 19:38
1

The machine you use to power your application will be configured to handle your application needs. That configuration may not be optimal for static assets. You could run nginx/lighttpd on the same machine to deal with your static content and build your own CDN while keeping your application servers configured to run your application optimally. There is an inherent cost to doing it yourself versus subcontracting out portions of it to someone that does only that.

Whether it makes more sense to do it inhouse versus contracting a CDN is a financial/effort question that you'll need to answer, but, depending on your application, the servers you're deploying, the configuration you can come up with, you could avoid using a CDN vendor. You could focus on the application and allow someone to handle it, or, have to be well versed in handling the complete package.

  • Ok. so lets say that the static content hosting is outsourced to CDN. how do i set up the apache servers? i guess the right way to go is hosting companies, but should one use managed hosting (they install the hardware + software) cause i guess that i cant fly to all countries and set it up manually or have employees doing it on place (due to costs, and staff overhead) which means that dedicated servers are out of the question? and so goes VPS for being too slow. Is the solution called managed hosting for the dynamic content apache servers (1 mysql server + 1 apache server in each location)? – ajsie Apr 05 '10 at 23:07
  • Your application design is going to influence your deployment. Can your satellites run mostly detached, or are they having to communicate with the main node frequently? That will determine the amount of connectivity and the paths back to your main site. You might find data centers in 2-3 countries will handle about 90% of your traffic well enough and then you can identify where you need to expand. Managed versus unmanaged is up to you. Do you want to handle application + server management? Identify your potential markets and find hosting companies that cover those areas. –  Apr 05 '10 at 23:25