Consider the below assumptions
With the above assumptions, let's answer the below question
How many requests do we need to handle every day?
Since we have 1 million daily users and each user makes 5 requests.
Total requests = daily active users * number of requests per user
Total requests = 1 million * 5 requests
Total requests = 5 million requests
How many Requests per Second (RPS)?
Total number of requests daily = 5 million requests (assuming each user performs 5 actions daily)
Therefore, requests per second (RPS) can be calculated as follows:
RPS = Total requests per day / Number of seconds in a day
RPS = 5,000,000 / 86,400 seconds (24 hours * 60 minutes * 60 seconds)
RPS ≈ 57.87
So, the system needs to handle approximately 58 requests per second on average.
How much storage do we need per day?
Each message is assumed to be about 500 bytes.
Total storage needed daily can be calculated as:
Daily storage = Total daily messages * Average message size
Daily storage = 5 million messages * 500 bytes per message
Daily storage = 2,500,000,000 bytes
Converting bytes to gigabytes (GB):
1 GB = 1,073,741,824 bytes
Therefore, Daily storage ≈ 2.33 GB
So, the system needs approximately 2.33 gigabytes of storage every day to accommodate the messages generated.
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design...
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?