How basmao9/aws-order-notification-system works
Project Type and Purpose
• This is a serverless, event-driven order-processing backend built on AWS.
• It ingests order messages, buffers them, processes them via Lambda, persists to DynamoDB, and handles failures via an SQS DLQ.
File Structure
• Top level:
• README.md – overall description and flow
• cloudformation-template.yaml – infrastructure as code (SNS, SQS queues, DLQ, Lambda, DynamoDB)
• lambda.js – the Lambda handler that parses events and writes to DynamoDB
• DLQ-visibility-timeout.md – notes on tuning the DLQ and visibility timeout
• There are no separate “frontend” or “microservice” directories; all logic lives in one Lambda function and supporting infra.
README for Additional Insights
• Core services: SNS Topic (OrderTopic), SQS Queue (OrderQueue), DLQ (OrderDLQ), Lambda (ProcessOrderFunction), DynamoDB table (Orders).
• Message format, error-handling strategy (maxReceiveCount=3 before DLQ), and attribute definitions are all specified.
Main Components
a. Publisher (could be a user, API Gateway, or another service)
b. SNS Topic (“OrderTopic”)
c. Primary SQS Queue (“OrderQueue”)
d. Dead-Letter Queue (“OrderDLQ”)
e. AWS Lambda Function (“ProcessOrderFunction”)
f. DynamoDB Table (“Orders”)
g. (Optionally) CloudFormation stack as the deployment orchestration layer
Relationships and Data Flows
• (Optionally) CloudFormation Template deploys all resources in one stack
Architectural Patterns and Design Principles
• Event-driven decoupling: SNS publishes asynchronously, SQS buffers, Lambda processes
• Resilience: DLQ for poison messages, visibility-timeout tuning
• Serverless: no servers to manage, infra defined in CloudFormation
• Single responsibility: Lambda only processes and persists orders
Capturing Essential Details
• Visibility-timeout tuning from DLQ-visibility-timeout.md.
• Optional: annotate the CloudFormation template as the “Infrastructure as Code” layer that provisions all services.