flowchart TD
user[User] --> api_gateway{API Gateway}
api_gateway <--> user_service[User Service]
user_service <--> user_db[(User DB)]
api_gateway --> payment_service[Payment Service]
payment_service <--> |writes|payment_db_master[(Payment DB Master)]
payment_db_master --> payment_db_replica[(Payment DB Replica)]
payment_service <--> |reads|payment_db_replica
payment_service --> payment_request_mq[/Payment Request MQ/]
payment_request_mq --> external_payment_service[External Payment Service]
external_payment_service --> payment_response_mq[/Payment Response MQ/]
payment_response_mq --> payment_service
external_payment_service <-...-> external_payment_system[External Payment Systems]
api_gateway --> allocation_service[Allocation Service]
allocation_service <--> |writes|allocation_service_db[(Allocation DB Master)]
allocation_service <--> |reads|allocation_service_db_replica[(Allocation DB Replica)]
allocation_service_db --> allocation_service_db_replica
allocation_service <--> |Check payment status|payment_service
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?