Detailed Component Design
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
- If we want to scale this, we could add a load balancer and that maps requests for servers. Maybe assign to server based on shortest queue
- For the database, if this is getting sufficiently large, we could use sharding to make it easier to retrieve data. We would probably want to shard by tinyurl so the system can route directly based on a GET request since that's what we're optimizing for
- We want to cache the most frequently requested urls across the whole system, not just the user level. You could even cache geographically, since we're using a CDN you can cache the most relevant URLs in say the EU on a CDN in the EU
- Given that we want high availability, we will also want redundancy. I'm assuming that the CDN and server is where we want the most redundancy. We can also add some redundancy on the databases