Start with functional requirements with constraint
User login/registration/manage profiles
View list of products
Add product to catalog
Order checkout
Payment
Notification
Guest user, order history (excluded)
Non functional requirements
Per day order processing 100K
Platform should be highly available during increased workload
Platform should ensure consistency and prevent duplicate order/ payment.
Make security a first-class requirement
Prevent bot/ DDoS attack on the platform
Only registered/ logged in user can place order
Calculate transaction per second(TPS) roughly
Its’s critical metric in system design, impacting decisions about server capacity, database design, network infrastructure, and more.
A purchase flow typically triggers many more reads (catalog read, inventory check, pricing, user profile, coupon validation) needs to be considered for TPS calculations but can be descoped during interview discussion.
Active Users: 1 million users.
Transactions per Purchase: Each purchase involves 3 transactions (item selection, payment processing, order confirmation).
Total daily transactions = Number of users × Transactions per user per day (considering single transaction per user per day)
1,000,000 * 1*3= 3 millions transactions per day
Converting to TPS:
There are 86,400 seconds in a day.
TPS = Total daily transactions / Seconds in a day.
TPS = 3,000,000 transactions / 86,400 seconds ≈ 34.72 TPS.
Calculate Storage requirement
Consider 10 KB* 3 = 30 KB
3 millions *30 KB
3,000,000 × 30 KB = 90,000,000 KB
Decimal (1 KB = 1000 bytes):
90,000,000 KB = 90,000,000 / 1000 = 90,000 MB = 90,000 / 1000 = 90 GB roughly 1 TB storage per day
Design the architecture to satisfy these constraints

Top comments (0)