Reputation: 45
I've got the order microservice that's written as go AWS lambda function.
The main function named order-service bound to API Gateway. It receives several parameters like user_id:int, product_ids:array
of int, creates an order with artifacts and returns serialized order with order_id and total price.
This function invokes a function named order-item which creates an order-item and returns them in parallel(per product). These functions invoke product and user functions to retrieve information about user and products by their ids.
Then, the order function invokes another lambda called fee-function which takes just total price and user id and gives back fee price. Of course, it calls some other function like user function and so on. Basically, this is a simple example of how the service works in general. Any function calls some others like user-discount, state taxes etc.
The questions are:
The main reason why I asked is to withstand thousands of RPM and not pay a lot.
Thanks for helping. I appreciate this.
Upvotes: 3
Views: 223
Reputation: 3506
This is exactly what Step Functions was created for. You can invoke a Step Functions state machine from API Gateway, as you would a Lambda.
With Step functions you can:
See the AWS Step Functions Getting Started Guide for a good introduction to the service.
Upvotes: 1