System Design: How DNS & CDN works behind the Internet?
DNS & CDN????? ๐ค Those aren't same!
Starting with DNS
Imagine you're in a big city like Delhi and need to find your friend's house. You know their address, but wouldn't it be easier if you could just ask someone for directions? That's kind of what the Domain Name System (DNS) does for websites!
Let's start with an example, think of websites like your friend's house, they have unique addresses (IP addresses) like 111.222.333.444, but they're hard to remember, right? That's where DNS comes into the play. DNS is like a giant phone book for the internet. It translates easy-to-remember domain names like to their corresponding IP addresses, and when you type a website address, your computer asks a DNS server for the IP address. It's like asking a local shopkeeper for your friend's house number!
There are many DNS servers around the world, like having phone books in different cities. This ensures quick response even if one server is busy.
Now, imagine your friend moved to another city! Wouldn't it be faster to visit a shop closer to their new place? That's the idea behind Content Delivery Networks (CDNs).
Read More:What is DNS? | How DNS works | Cloudflare
CDN: Deliver content faster from PoPs across the world
Websites have content like images, videos, and text. Downloading this content can take time, especially if you're far from the website's server. CDNs store copies of website content in servers around the world, like having mini shops in different cities closer to your friend's new house. When you visit a website, your computer connects to the nearest CDN server, getting the content much faster than downloading it from the original server far away.
Think of it like buying snacks from a nearby shop instead of traveling all the way to the main store! CDNs make websites load faster, especially for people in different parts of India.
Some popular CDNs include Cloudflare, BunnyCDN & KeyCDN.
So, DNS helps us find websites using their names, and CDNs deliver their content quickly through nearby servers. Both are essential for a smooth and fast internet experience, just like having a good address book and local shops in a big city!
Read More: What is a content delivery network (CDN)? | How do CDNs work?