Let us assume we have to handle 10 Million transactions per day. To calculate the transactions per second, we'll divide the total number of transactions per day by the number of seconds in a day.
Total transactions per day = 10,000,000
Number of seconds in a day = 86,400
Transactions per second = Total transactions per day / Number of seconds in a day
Transactions per second = 10,000,000 / 86,400
Transactions per second ≈ 115.74 transactions per second
So, the system needs to process approximately 115.74 transactions per second.
Given that 1 server can handle 1000 concurrent requests, we'll need to calculate the number of servers required to handle the total load.
However, for high availability scenarios, we need to consider redundancy and failover. Let's assume a redundancy factor of 2 for high availability.
We can roughly estimate 200 servers will be required to support our scale.
If each transaction contains 100 KB of data, we can calculate the total data generated per year and then estimate the storage required for 5 years.
Data per transaction = 100 KB
Total transactions per year = 10,000,000 * 365 ≈ 3,650,000,000
Total data generated per year = Data per transaction * Total transactions per year
Total data generated per year = 100 KB * 3,650,000,000 ≈ 365,000,000,000 KB
Total data generated for 5 years = Total data generated per year * 5
Total data generated for 5 years ≈ 365,000,000,000 KB * 5
Total data generated for 5 years ≈ 1,825,000,000,000 KB
Total data generated for 5 years ≈ 1.825 petabytes (PB)
So, approximately 1.825 petabytes of storage will be required for 5 years.
Performance Requirements:
For designing payment systems, multiple APIs will be required, below is a list of few essential APIs.
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?