This Guidance demonstrates how restaurants can synchronize changes to their menus across all customer channels, including web, mobile, and physical locations. By implementing near real-time updates to prices and availability, restaurants can ensure their customers always have access to the current menu.
Architecture Diagram
Step 1
All services including: menu create, menu update, and menu retrieve are front-ended by Amazon CloudFront for performance with AWS WAF (a web application firewall). This protects the content from common exploits.
Step 2
Images and static objects are stored in Amazon Simple Storage Service (Amazon S3) for cost and performance efficiency.
Step 3
All APIs are hosted as edge-optimized APIs on Amazon API Gateway. Amazon Cognito is used for security and AWS Identity and Access Management (IAM) is used for authentication. Caching on API Gateway helps improve performance.
Step 4
The actual functionality for managing the menu are realized using AWS Lambda.
Step 5
Amazon DynamoDB global tables are used to store the menu data and changes to the menu are propagated using a DynamoDB stream. This enables a multi-region active-active data store.
Step 6
Lambda is used to create an event generator that listens to events on DynamoDB streams to build and emit menu create, menu update, and menu delete events.
Step 7
Menu change events are published on Amazon Simple Notification Service (Amazon SNS) where the different applications can subscribe to changes using filter policies for events of interest.
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
AWS WAF protects the API’s from common web exploits such as SQL injection (SQLi) or cross-site scripting (XSS) attacks. The AWS CloudFormation script helps make frequent, small, and reversible changes to the environment, resulting in an agile platform. Billing and logging details are also captured, making it easier to do any subsequent exercises. Using Amazon CloudWatch Events, customers can respond to each breach of thresholds to ensure they do preventive controls.
-
Security
The core services are securely made available through API Gateway that leverages IAM and Cognito to provide authentication and authorization. Lambda uses identity-based security policies to connect to DynamoDB securely. Amazon SNS integrates with IAM so that customers can control which Amazon SNS actions a user can perform in their AWS account. DynamoDB protects user data at rest and in transit between Regions.
-
Reliability
The core menu management services run on Lambda, which scales seamlessly and with high reliability. DynamoDB also scales based on load.
-
Performance Efficiency
Resource provisioning and management is automated through serverless architecture including: Lambda, API Gateway, Amazon SNS, and DynamoDB.
-
Cost Optimization
Monitoring expenditure and usage is done through the AWS Billing Console. The use of serverless compute, such as Lambda, ensures cost optimization, as services are billed on usage. Lambda costs are based on the number of transactions whose usage is governed by AWS Cost Explorer. DynamoDB can be provisioned for auto-scaling, which incurs costs proportional to the usage.
-
Sustainability
Workloads are always scaled to the right-size with dynamic auto-scaling of serverless services like Lambda, DynamoDB, and API Gateway. This ensures high utilization and maximizes the energy efficiency of the underlying instances, services, and its hardware.
Implementation Resources
A detailed guide is provided to experiment and use within your AWS account. Each stage of building the Guidance, including deployment, usage, and cleanup, is examined to prepare it for deployment.
The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
Related Content
[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.