Loading...
As the application is read and write heavy. create a separate applications to read/get the long URL for a short URL and separate application servers to generate and write the Short URL for a given long URL.
the URL will be persisted in the database and at the same it it will be added in the cache.
Once the read request receives from the user first lookup into cache if found then return to the user else lookp to database and write into cache before retuning to the user.
cache evict policy will be lease recently used. the URLs which used less number of times will be removed from the cache.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.