how the internet mafia works
I have been making a ton of progress for my AWS certification exam that is coming up soon and today I covered 2 sections. One about relational databases/caching and the other about the internet web-address mafia, but more officially known as Route 53.
1) Caching. For AWS to cache RDS, there are two main strategies:
- Lazy loading which is where you can search cache and then on a cache-miss, read from the database and then cache this request so the next time, requests can be read quicker from the cache.
- Write-through which is immediately after writing where you cache a request.
- You can incorporate TTL (time to live) rules so that cache-eviction process occurs to keep the cache small. When TTL expires, items are removed and in case the cache is full, the least recently used (LRU) cache items are removed first. But removing cache and knowing the timing of the TTL is always a guess/fuzzy rule.
- *There are only 2 things hard in computer science: cache invalidation and naming things* ~ Phil Karlton
2) Next, DNS basics. To understand this, we have to first ask ourselves, how does your internet browser know what address to direct to when given a website, joharapurkar.com for instance? Well, your browser has to first check your stub-resolver whether the website has been accessed. If so, then it looks up the address from its cache. But if this is the first time, then it goes to the Local DNS Server, run through your internet provider who does the following look ups:
- It starts at the root DNS server that is organized by multiple organizations (coordinated by ICANN). It doesn't know individual websites, so it will then direct the local DNS server to search for just the .com (TLD) part.
Then the local DNS server will then ask the TLD DNS server which will return with the address of the SLD DNS server, a name-server (for example Amazon Route 53) that holds records for the SLD (joharapurkar.com). The local DNS server will then route to that server which will return back the actual IP address. This will then be stored in the DNS server's cache and then pass this to the browser which connects to joharapurkar.com using this address.
I think it's so interesting that there's this 'I know a guy' kind-of-chain that you have to keep following until you get your answer. It's actually surprising that the whole internet works this way and it happens in the background whenever you go to a new web-address. Kudos to the internet mafia.