System Design | Build Cart as a service | Feedback
2679

Came across this question:
Any feed back on this design ( a more clear resolution link https://pasteboard.co/yduYHVEkHyo0.png )

image

Explanation of how the service operate and the end points it uses

  1. e-commerce Service will interact with Cart Service add/update/ delete item.
  2. cart service can make call to the inventory service to check if any item is out of stock . The flow of this is :e-comm service calls checkForOutOfStockItem which calls getProductAvailability from inventory service. ( we can also add notification service to notify user)
  3. cart service makes call to checkout service when user want to checkout using checkout cart. Since checkout can be heavy service ( it verifies inventory, make the payment ) result might not be right away available ( if it is well and good ) . Therefore giving the facility for the checkout service to give a call back when it has the status available using updateCartItem. If that doesn't happen then checkout service should have an end point :getStatusOfCart so cart service can use and figure it checkout was successful.
Comments (6)