Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
GET /v1/url/{shorten_url}
{
String long_Url
}
POST /v1/url
{
String long_url
}
Returns shorten_url
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
Write through, read aside cache to handle freqeuently read URLs and recently created URLs to target sub 200ms latency
We have distinct services for the read and write to seprate these concerns and achieve high throghput
We utilize a SQL database that is sharded by eithe region/consistent hashing or range to scale our write speeds
and we use high level of replications per shard tot maintain high read speeds. We utilize a queue ot handle async data replications with data preservation.