Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
Shorter should have 2 endpoints for
shortenUrl(url) - returns shortened url to the user, and stores in DB - POST.
getUrl(shortUrl) GET - fetches url and redirects to the user.
we have cdn for finding closes server,
load balancer for redirecting user to closes API
2 microservices shortner service and redirect service.
Shortner stores most recent ursl into redis and dynamo db.
for sake of latency we fetch newly created urls from redis cache.
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.