Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

My 2 Cents Advantages & Disadvantages Of Using Cdn For Websites

Discussion in 'Content Delivery Networks (CDN)' started by Oldwriter, Feb 5, 2016.

  1. Oldwriter

    Yellow Belt

    Joined:
    Dec 10, 2015
    Messages:
    64
    Ratings:
    +28 / -0
    If you have one or more websites with consistent traffic, you may want to ponder using a CDN for enhancing your visitors' usage experience.

    We are going to review the advantages and disadvantages of using a CDN in this WebMasterServe article. Let's start with an introduction to the concept.

    What is a CDN?

    CDN stands for Content Delivery Network (also referred to as Content Distribution Network). A CDN is a system comprised by an array of computers replicating content that is copied from your website's main server to a location that is closer to the end-user.

    This seemingly simple concept provides you and your visitors with better latency and a better overall experience.

    How does a content delivery network work?

    This is a diagram of a regular website setup:

    CDN-regular-arrows_535.

    With this arrangement, your visitors are served directly from your main hosting account. If you aren't enjoying the services of a CDN, chances are you are using this structure right now.

    Let's expand the diagram to include a Content Delivery Network between your site's server and your users:

    CDN-edge-servers-arrows_535.

    Now your main hosting server sends website content copies to your CDN's servers -called “Edge servers”- for them to propagate. The CDN replicates this source content across several hosting facilities they maintain worldwide.

    Once your content is cached on several locations it will be closer to your visitors, so your site can enjoy the advantages associated with using a CDN.

    A CDN works with different servers and content types. It is valuable to know them for understanding why you need a CDN as well as appreciating the benefits you enjoy when hiring one.

    CDN server types:

    Origin server

    origin-server_263x320.


    The origin server is the machine that hosts the “master copy” of the content to be replicated across the CDN.

    It is the machine where the website would be hosted if there were no CDN; the origin server is your website's main server.

    Edge servers


    edge-server_271x320.

    An edge server is the machine that replicates your website's contents and forwards it to the visitors in order to actually achieve the benefits of having a CDN.

    There are several edge servers in a CDN setup. They host the cached copies of your website's content pulled from the origin server.

    Edge servers are provisioned by (and the responsibility of) your CDN provider. These servers are what you actually buy when hiring a CDN.

    CDN content types:

    Static content:

    iceberg_692x320.

    This category comprises all the files that are generated and ready to be used as single entities. Images, CSS, JavaScript and other seldom-changing content is static. They are cache-able by the CDN without a problem. Actually, static content was the main reason for CDNs to see the light, hence it is the “native” type of content for CDNs to cache in a straightforward way.

    Dynamic content:

    falls_427x320.

    This is actual real-time content. This type of content is transferred from your origin server to the user directly. Its use-case excludes cached copies.

    An example would be a real-time web cam which has to be streamed without incurring in further delays. Also, any time-critical flow of data which needs to be evaluated as soon as it is generated falls into this category.

    Dynamic content is truly unique; you never get the result of a dynamic content request twice.

    Event-driven content:

    newtons-cradle_213x320.

    This type of content is static for an unspecified amount of time, with the distinct quality of having an “event” attached to the content that makes it change. This event can be an edit by the publishing user or site administrator, an update by an automated script fetching results from a separate feed, or any other mean that ultimately alters the cached content.

    Your CDN must cache this type of content for as long as it remains unchanged, then when the event triggers, you “un-cache” it in order to let your CDN's servers update with the new copy.

    This clearing is made by your server issuing an API command to the CDN when the content-altering event is detected. This command is akin to purging the content from the CDN's servers immediately, hence the next time an up-to-date version is obtained from the origin server to be cached and served afresh.

    We can see examples of event-driven content in things like a wiki page, which remains constant until a user updates it; a forum post or blog comment, a “last articles” widget fetched from a third-party website that is updated only when a new article is added. Any content that has an unpredictable time of validity after being generated can be cached in this event-driven way.

    Advantages of using CDN for websites

    A large chunk of all the internet content being transferred today is served from CDN facilities. The CDN approach has several advantages for websites of all kinds. Let's check them out.

    Efficient bandwidth usage on origin server

    network-cables_481x320.

    A modern webpage is a mix of objects which are commonly fetched asynchronously in separate files. The webpage's main HTML file, as well as all of its fetched elements, can benefit from being cached to a location closer to the user so they travel less through the network in order to reach the user's browser for being displayed faster.

    While there is dynamic content that is simply impossible to cache, there are also many cache-able objects in a modern webpage such as: CSS style sheets (.css), JavaScript files (.js), video (.flv, .mp4), image files (.png, .jpg, .gif) and several other external resources.

    Some of these non-html files can be bulky, hence the benefit from loading these files outside of your main server can be very big in terms of bandwidth when offloading it to a CDN.

    After being freed from serving these bandwidth-intensive files, your origin server resources are kept for delivering actual dynamic content, making the overall usage of resources more efficient when you hire a CDN.

    High availability

    light-bulb_481x320.

    With a single point of access also comes a single point of failure. Downtime is a severely-negative trait for any website to have. When your website is down your visitors aren't interacting with it and you aren't making money nor generating value from their activities in your Internet space.

    By replicating your website across several servers worldwide when you employ a CDN, you are in a better position to squash downtime and achieve the always-on status from your users' point of view.

    CDNs monitor their servers' health proactively. When an edge server is down, your visitors are redirected to the nearest active one so they don't get to perceive any downtime when accessing your website.

    Absorbing Distributed Denial of Service (DDoS) attacks

    Any website is open to a distributed denial of service attack where the attacker uses a network of “zombie” computers (known as a bot net) to make a lot of simultaneous requests to the target site trying to saturate it so regular users are prevented from using it.

    HTTP servers have a limit on the maximum number of concurrent connections they can handle. If you are hosting your website on a single server, then an attacker can target your only box by clogging it to achieve its maximum number of connections so your legitimate users are blocked from accessing it.

    There are also “ransom attacks” on which the attacker keeps on making your website unavailable for legitimate users until you pay them money, most likely in Bitcoin or other “untraceable” e-currency.

    The more popular your website becomes, the more prone it is to DDoS attacks, but -on the bright side- thanks to Content Delivery Networks, with their many servers spread across the globe, your website is better suited to handle denial of service attacks.

    When your site is being served from a CDN, attackers can't overload it as easy because the many edge servers can absorb the DDoS attack better. Each of the CDNs edge servers has its own maximum concurrent account limit, hence the website is harder to overload for legitimate users. A BIG win when your site is popular and you end up being targeted by the bad guys.

    Faster site access / performance boost

    underground_481x320.

    Perhaps the most obvious (and most sought-after) benefit of a CDN is the accelerated access a CDN can provide. In particular, having less latency and less loss of packets since the data has to travel less to reach the serviced device.

    CDNs are natural performance booster by means of their distributed nature.

    The speedier site access brought by your CDN helps improve site stickiness and in general adds to a better user experience, a total must these days with so much competition on the web.

    Disadvantages of using CDN for websites

    Extra/hidden costs

    If you don't choose the correct CDN, you may end up paying hidden fees, being charged extra per GB, locked into minimum commitments, charged by HTTP headers and other subtle terms in the contract making your fees higher than they should be.

    [ We recommend KeyCDN because of its very clear contract terms and cost structure ]

    Impractical for some websites

    If your website deals mostly with truly dynamic content (as opposed to event-driven one) then you are out of luck. Your origin server would basically receive the same load with a CDN because truly dynamic content isn't cache-able.

    Multiple server maintenance

    When using only one server, you can modify every factor and can readily update, patch and in general modify & adapt this single server to your specific needs. When offloading your content to several servers worldwide, the overall server maintenance needs also multiply. Will the CDN provider you hire patch and maintain every single server on their network in good shape at all times? If something happens will they address it quickly?

    You have to use a CDN with a proven track record if you are going to trust their edge servers with being the actual servers your users get to interact with. Your CDN provider is definitely an important choice in this respect, with their ability to maintain their network of servers in good shape being a big point to consider.

    Our recommendation:

    If you want to avoid these disadvantages while enjoying all the advantages a CDN can bring to your website operation, we recommend you to try KeyCDN.

    After testing others being on the cheap but not offering a reliable quality, as well as checking some having good quality but being expensive for small to medium sites, we settled with KeyCDN. It has use-based pricing, proving to be very affordable for small to large sites and it also provides good quality of service with a nice user interface.

    Experience how a CDN performs for your website: get your no-cost trial at: KeyCDN.com
     
    #1 Oldwriter, Feb 5, 2016 at 4:34 PM
    Last edited: Feb 6, 2016
  2. coolyfrost

    Yellow Belt

    Joined:
    Jan 23, 2016
    Messages:
    135
    Ratings:
    +9 / -0
    Thanks for the insightful guide OP! I actually did not know about CDNs, but I guess that they make sense in order to reduce the amount of latency on websites. How much extra upkeep do you think there would be for a CDN server? Do you think it is worth it to incite more web traffic?
     
  3. Yuva12

    White Belt

    Joined:
    Nov 23, 2018
    Messages:
    135
    Ratings:
    +1 / -0
    Disadvantages:
    - Increased cost
    - Extra development/optimization if you are not using standardized systems.

    Advantages:
    - Speed
    - Less load on server
     

Share This Page