Requirements
Functional Requirements:
- there is 10 million user
- they can generate url
- this url expiry after 60 days
- 100000 QPS read
- if we get url size of 4kb and 2kb for strage purpose and have exipiry of 60 days so storage will be reqired of total 6kb for each row lets take 10 kb to add timestamp and user id as well so total storage would be 10*10000000*60 total 600gb of data base is require
Non-Functional Requirements:
- system needs to be up and running and p99 should be less than 1 sec.
- as its read heavy database we can use Mysql with slave and master architecture
- need to scale automatically with sudden burst of request Horizontal scale
API Design
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...
High-Level Design
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.
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.