Build A Serverless Order Processing E-commerce Microservice
A simple but highly scalable way to build an order processing feature on the cloud.
In this article, I’ll guide you through building out a serverless microservice that will be able to process orders for an e-commerce application at scale.
There are quite a few pieces involved to accomplish this but I’ll make it super simple to understand and reproduce for yourself.
So strap in and let’s get started!
Overview
The general overview of this microservice looks like this:
When a customer places an order through a Lambda function URL, the request is routed to a Lambda function which sends a message with the order details to an SQS queue.
Asynchronously, another Lambda function will be triggered whenever a new message is sent to SQS. The function will process the message which contains the order details and will write them to a DynamoDB table as well as write an order receipt as a file in Amazon S3.
The function then sends a notification to an SNS topic, which triggers an email alert for a new order.