The price is needed before checkout can continue
How an API Gateway endpoint that invokes Lambda synchronously returns a result the caller needs before continuing, and how waiting ties the caller’s latency and ability to finish to Lambda’s response.
A checkout client asks for a shipping quote because it needs the amount before it can display the order total. In synchronous communication, the work that needs the result waits for the response. The client can still do unrelated work, such as showing a loading indicator.
In this design, an API Gateway REST API uses a Lambda proxy integration. API Gateway waits for the Lambda function to calculate the quote and returns the outcome on the original HTTP request. The client does not have to make a second request to get the quote.
Stage 1 of 4: Start at the checkout client: it needs the shipping amount to display the order total.
Next up: Complete the diagram on what you just read.
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.