Domain Name System and Content Delivery Network (CDN) PDF

Summary

This document provides an overview of the domain name system (DNS) and content delivery networks (CDNs). Topics covered include how DNS translates domain names to IP addresses and the benefits and drawbacks of using CDNs. Diagrams of the system are included for visual learning.

Full Transcript

09 Domain Name System, Content Delivery Network (GitHub System Design Primer) Domain name system *[ Source: DNS security presentation ]()* A Domain Name System (DNS) ** == == ** translates a ** domain name ** such as www.example.com...

09 Domain Name System, Content Delivery Network (GitHub System Design Primer) Domain name system *[ Source: DNS security presentation ]()* A Domain Name System (DNS) ** == == ** translates a ** domain name ** such as www.example.com [ ]() to an ** IP address. ** DNS is ** hierarchical, with a few ** ** authoritative servers at the ** ** top level. ** Your ** router or ** ** ISP ** provides information about which ** DNS server(s) ** to contact when doing a ** lookup. ** ** Lower level DNS servers ** ** cache mappings, ** which could become ** stale due to ** ** DNS propagation delays. ** ** DNS results ** can also be cached by your ** browser or ** ** OS ** for a certain period of time, determined by the [** time to live (TTL). **]() ** == NS record (name server) - Specifies the == ** ** DNS servers for your ** ** domain/subdomain. ** ** == MX record (mail exchange) - Specifies the == ** ** mail servers for accepting messages. ** ** == A record (address) - Points a name to an IP address. == ** ** == CNAME (canonical) - Points a name to another name or CNAME (example.com to == ** ` ` [ www.example.com) or to an A record. ]() ` ` ⠀ Services such as CloudFlare and Route 53 provide managed DNS services. Some DNS [ ]() [ ]() services can route traffic through various methods: [ Weighted round robin ]() Prevent traffic from going to servers under maintenance Balance between varying cluster sizes A/B testing [ Latency-based ]() [ Geolocation-based ]() ⠀ Disadvantage(s): DNS Accessing a DNS server introduces a slight delay, although mitigated by caching described above. DNS server management could be complex and is generally managed by governments, [ ISPs, and large companies. ]() DNS services have recently come under DDoS attack, preventing users from accessing [ ]() websites such as Twitter without knowing Twitter's IP address(es). ⠀ Source(s) and further reading [ DNS architecture ]() [ Wikipedia ]() [ DNS articles ]() ⠀ ** Content Delivery Network ** *[ Source: Why use a CDN ]()* A ** content delivery network (CDN) ** is a ** globally distributed network of proxy servers, serving content ** ** ** from ** locations closer to the user. ** Generally, ** static files such as ** ** HTML/CSS/JS, ** ** photos, and ** ** videos ** are served from CDN, although some CDNs such as ** Amazon's CloudFront ** support ** dynamic content. ** The site's ** DNS resolution ** will tell clients which ** (CDN Edge) server ** to contact. Serving content from CDNs can significantly improve performance in two ways: Users receive content from ** data centers ** ** close to them ** Your servers do not have to serve requests that the ~~ ~~ CDN fulfills ⠀ ** Push CDNs ** * Push CDNs receive * ** new content whenever ** changes occur on ** your server. ** You take ** full responsibility for providing content, ** ** uploading directly to the ** CDN and ** rewriting URLs ** to point to the CDN. You can ** configure when content expires and ** ** when it is updated. ** Content is uploaded only when it is ** new or ** ** changed, ** ** minimizing traffic, ** but ** maximizing storage. ** Sites with a ** small amount of traffic or sites with ** ** content that isn't often updated ** work well with push CDNs. Content is ** placed on the CDNs once, ** instead of being ~~ re-pulled at regular intervals. ~~ ** Pull CDNs ** Pull CDNs grab ** new content from your server when the ** ** first user requests the content. ** You ** leave the content on your server and ** ** rewrite URLs ** to point to the CDN. This results in a ** slower request until the content is ** * * ** cached on the CDN. ** Disadvantage(s): CDN CDN ** costs could be significant ** * depending on * ** traffic, ** * although this should be * ** weighed with additional costs ** you would incur ** not using a CDN. ** Content might be ** stale if it is updated before the TTL expires it. ** CDNs ** require changing URLs ** for static content to point to the CDN. ⠀ Source(s) and further reading [ Globally distributed content delivery ]() [ The differences between push and pull CDNs ]() [ Wikipedia ]()

Use Quizgecko on...
Browser
Browser