| Condition | Total Requests/Day | Requests/Second (RPS) |
| Normal Traffic | 350,000 | ~4.05 |
| Moderate Peak (2x) | 700,000 | ~8.1 |
| Moderate Peak (4x) | 1,400,000 | ~16.2 |
| High Traffic (5x) | 1,750,000 | ~20.3 |
| High Traffic (10x) | 3,500,000 | ~40.7 |
Customers
50,000×1 KB=50 MB
50,000 x 1 KB = 50 MB
Products
10,000×2 KB=20 MB
Orders
Average size per record: 1.5 KB
30,000×1.5 KB=45 MB
Order Items
The system can be divided into several layers/components:
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...
Choice: For the initial phase, a microservices architecture is proposed, dividing the system into smaller, independently deployable services (e.g., authentication, product management, order processing).
Trade-offs:
Choice: A relational database system (e.g., PostgreSQL or MySQL) was chosen over NoSQL databases (e.g., MongoDB, Cassandra).
Trade-offs:
Choice: Implementation of a caching layer using Redis to speed up access to frequently requested data (like product lists and user sessions).
Trade-offs:
Choice: Opted for RESTful APIs rather than implementing GraphQL.
Trade-offs:
Choice: Chose to deploy the application on a cloud provider like AWS or Google Cloud Platform instead of on-premises servers.
Trade-offs:
The database may become a bottleneck during peak traffic (e.g., weekends, holidays) if requests for product information or order processing exceed its capacity.
If the API layer is overwhelmed with requests (especially during promotional periods), it might become unresponsive.
If the external payment provider experiences downtime or latency, payment processing requests may fail.
Microservices designed for specific functionalities (like user authentication, order management, etc.) could fail or become unresponsive.
Issues like high network latency or complete network outages can disrupt communication between client devices, API layer, and database.
A bug in the web or mobile app might lead to crashes or significant usability issues during high traffic.
Data can become inconsistent, especially if multiple services are involved and not properly synchronized.
Running out of computational power, memory, or storage can cause slowdowns or outright failures of services.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?