input ui for submitting long uri
storing the long uri and short uri mapped
consistency is needed we cannot risk of routing to wrong web page we need to keep out db consistent
Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
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...
api to get the page which contians ui to submit the long uri
api aftring submitting long uri hash function or any method to shorten the uri and then storing in db
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
backend api
mongodb
and front end using the vuejs
also aws services like loadbalancer
ratelimiting
caching using redis
cloudwatch frro logs
code commit for code commit history
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...
its better have flexible schema
schma is like sort uri and its repseictive long uri
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
db will be consistent thats why the we tradeoff will be availability
in redis the cache will be most requested short uri and ttl is 1 day