Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I plan to create and run my own CDN. Currently, media and other static content is being served by the web-servers which are behind a load balancer which is a waste of resources. The network structure of my web application (with the CDN) will be as follows:

  • 1 load balancer node for the web servers (nginx)
  • 3 web server nodes (apache, php)
  • 2 database nodes (mysql)
  • 1 load balancer node for the CDN (nginx)
  • 3 CDN storage nodes (apache, php)

How could I transfer files to the CDN from the nodes which generate media? For example image processing after file uploads.

share|improve this question
2  
I'm not sure if i'm right in understanding what you mean. But a CDN does not host copies of your files. They hold a cached copy of your file –  Liam Sorsby Jan 30 at 17:40

1 Answer 1

A content delivery network works as a proxy server. You would have to have a canonical source for your media. The CDN servers would then contact the central canonical source for the file the first time that it is requested. After that, they would serve the cached copy that they had retrieved the first time.

Different CDNs use different schemes for the central copy of the file. One way to set it up would be to have your main web server continue to serve all the files as normal. Users would be directed to the CDN which would take most of tho load off of your main servers.

I've also seen CDN setups where static media is hosted on a server run by the CDN company. In this case you might get FTP access to that server to upload new content. The nodes that generate the media would have to use FTP to place the content on the central server to then be distributed by the CDN nodes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.