Module 10: Developing with Messaging Services
AWS Academy Cloud Developing
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Section 1: Introduction
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module objectives
At the end of this module, you should be able to do the following:
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
3
Module overview
Sections
Demonstration
Lab
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
Knowledge check
Café business requirement
Currently, updating the coffee inventory on the website is a manual process. Sofía would like to find an easier way to keep the inventory updated. She considers setting up a messaging system to automatically receive and process inventory updates.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
5
Messaging services as part of developing a cloud application
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
6
Section 2: Processing requests asynchronously
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Synchronous processing
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
8
Tightly coupled
Client
Service A
Service B
Response/result
Request
Asynchronous processing
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
9
Client
Service A
Service B
Acknowledgement
Request
The result might be returned to the client through another process
Asynchronous processing�with messaging services
Message queues
Pub/sub messaging
Data streams
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
10
Amazon SQS
Amazon SNS
Amazon Kinesis�Data Streams
Message queues overview
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
11
Queue
Producers
Consumer
Poll for messages
Add messages to the queue
Process each retrieved message
Delete the processed message from the queue
1
2
3
4
Pub/sub messaging overview
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
12
Topic
Producers
Subscriber A
Push messages to subscribers
Subscriber B
Subscriber C
Add messages to a topic
Process messages of interest
1
2
3
Data streams overview
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
13
Stream
Producers
Consumer
Poll for messages
Add messages to the stream
Aggregate and analyze large numbers of messages
1
2
3
Section 2 key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
14
Section 3: Introducing Amazon SQS
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SQS
Fully managed message queuing service that eliminates the complexity and overhead associated with managing and operating message queues
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
16
Amazon Simple Queue Service (Amazon SQS)
Standard and FIFO queue types
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
17
Standard (default) | FIFO |
Best effort ordering, at-least-once delivery. Nearly unlimited throughput. | Message order is preserved, exactly-once delivery. More limited throughput. |
Use cases | Use cases |
|
|
|
|
|
|
Amazon SQS architecture example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
18
AWS Cloud
Auto Scaling group
EC2 instances
User
S3 bucket
SQS queue
Lambda function
Sends message about image to SQS queue
Processes image and sends back to S3 bucket
Polls SQS queue
Invokes Lambda function
Uploads photo to S3 bucket
Section 4: Working with Amazon SQS messages
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SQS message lifecycle
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
20
Producer 1
Consumer 1
A
SQS queue �(distributed on SQS servers)
A
A
A
SendMessage�Producer delivers message(s) to a queue
Amazon SQS redundantly stores the message across multiple Amazon SQS servers.
ReceiveMessage�Consumer polls the queue and retrieves messages
Amazon SQS sets the visibility timeout on the retrieved message(s) in the queue
DeleteMessage�After processing the message successfully, the consumer deletes it from the queue
1
2
3
Producer 2
B
A
B
B
B
B
Consumer 2
The SendMessage operation
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
21
Producer
aws sqs send-message �--queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue �--message-body "My first message"
{ �"MD5OfMessageBody": "51b0a325...39163aa0", �"MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE" �}
SQS queue
Example Amazon SQS response with MD5 hash of body and MessageID
Example AWS CLI command for SendMessage operation
The ReceiveMessage operation
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
22
aws sqs receive-message
--queue-url https://sqs.us-east1.amazonaws.com/80398EXAMPLE/MyQueue
--max-number-of-messages 10
"Messages": [
{
"Body": "My first message.",
"ReceiptHandle": "AQEBzbVv...fqNzFw==",
"MD5OfBody": "51b0a325...39163aa0",
"MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE",
"Attributes": {
…
},
}
]
}
Consumer
Example AWS CLI command for ReceiveMessage operation
Example Amazon SQS response with messages. Each message has a ReceiptHandle.
SQS queue
ReceiveMessage and visibility timeout
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
23
SQS queue
A
Time
ReceiveMessage�Consumer 1
Message A �returned
Message A �returned
Message A not�returned
ReceiveMessage�Consumer 2
ReceiveMessage�Consumer 3
ReceiveMessage�Consumer 4
Visibility timeout (default = 30 seconds)
A
A
A
A
A
Consumer 1 should process and delete message A from the queue before it becomes visible again
Message A not�returned
A
A
A
A
A
Configuring a dead-letter queue
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
24
Source SQS queue
A
Time
ReceiveMessage�
ReceiveMessage�
Visibility timeout
A
A
A
A
1
2
A
Visibility timeout
A
Consumer fails to complete processing
A
Consumer fails to complete processing
Dead-letter queue
A
A
A
3
Producer 1
A
A
maxReceiveCount= 2
ReceiveMessage and short polling
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
25
SQS queue
(distributed on SQS servers)
A
D
E
A
C
D
B
Messages
received from
sampled servers
ReceiveMessage request with WaitTimeSeconds = 0
B
C
E
E
C
D
A
C
A
E
B
B
C
D
D
A
B
Amazon SQS samples the servers
Consumer 1
Consumer 2
ReceiveMessage and long polling
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
26
SQS queue
(distributed on SQS servers)
A
D
E
A
C
D
B
Messages
Received from all servers
ReceiveMessage request with WaitTimeSeconds > 0
B
C
E
E
C
D
A
C
D
A
B
Amazon SQS queries all servers
E
A
E
B
B
C
D
Consumer 1
Consumer 2
ReceiveMessage long polling example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
27
https://sqs.us-east-1.amazonaws.com/123456789012/testQueue/
?Action=ReceiveMessage
&WaitTimeSeconds=10
&MaxNumberOfMessages=5
&VisibilityTimeout=15
&AttributeName=All;
&Expires=2019-04-18T22%3A52%3A43PST
&Version=2012-11-05
&AUTPARAMS
Retrieve messages from "testQueue" at this URL
Use long polling with a wait time of 10 seconds
Retrieve up to 5 messages at a time
Make these messages invisible to other consumers for 15 seconds
DeleteMessage operation
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
28
aws sqs delete-message
--queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue
--receipt-handle AQEBRXTo...q2doVA==
Consumer
Example AWS CLI command for DeleteMessage operation
SQS queue
Amazon SQS automatically deletes messages that remain in queue beyond the queue's retention period.
Amazon SQS deletes the message with the specified receipt handle. If you use the DeleteMessageBatch option, Amazon SQS responds with a list of successes and failures.
AQEBRXTo...q2doVA==
Amazon SQS message lifecycle operations summary
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
29
Producer 1
Consumer 1
A
SQS queue �(distributed on SQS servers)
A
aws sqs send-message �--queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue �--message-body "My first message"
aws sqs receive-message
--queue-url https://sqs.us-east1.amazonaws.com/80398EXAMPLE/MyQueue
--max-number-of-messages 1
1
2
3
Producer 2
B
A
B
B
Consumer 2
aws sqs delete-message
--queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue
--receipt-handle AQEBRXTo...q2doVA==
Section 4 key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
30
Section 5: Configuring Amazon SQS queues
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Standard SQS queues
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
32
Duplicates are possible
Messaging order is not guaranteed
Nearly unlimited throughput
Producer 1
Consumer 1
A
SQS queue �(distributed on SQS servers)
A
A
A
A
B
B
B
B
Consumer 2
B
C
C
C
C
C
A
C
B
C
App database
FIFO SQS queues
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
33
Messaging order is preserved
Producer 1
Consumer 1
A
SQS queue �(distributed on SQS servers)
A
A
A
A
B
B
B
B
Consumer 2
B
C
C
C
C
C
A
B
C
App database
More limited throughput
Messages are delivered exactly once
Creating and configuring queues
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
34
API operation | Description |
CreateQueue | Creates an SQS queue including queue attributes. If you don't provide a value for an attribute, the queue is created with the default value for the attribute. |
GetQueueAttributes | Retrieves attributes of a queue including those that help you estimate the resources required to process queue messages; for example, the approximate number of messages available to retrieve and how many are currently invisible. |
SetQueueAttributes | Sets attributes on an existing queue. |
GetQueueUrl | Retrieves the URL of an SQS queue. |
ListQueues | Retrieves a list of your queues. |
DeleteQueue | Deletes a queue, regardless of whether the queue is empty. When a queue is deleted, any messages in the queue are no longer available. |
Create SQS queue example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
35
aws sqs create-queue --queue-name MyQueue --attributes file://create-queue.json
Create a queue using the attributes in create-queue.json
create-queue.json
{
"RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":\"1000\"}",
"MessageRetentionPeriod": "259200"
}
Set the dead-letter queue destination
Set the message retention period to 3 days
Set the maximum receive count to 1,000
Three types of SQS queue security
AWS Identity and Access Management (IAM) and Amazon SQS policies
Server-side encryption (SSE) with AWS Key Management Service (AWS KMS)
Amazon Virtual Private Cloud (Amazon VPC) endpoint
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
36
Data encryption
Internetwork traffic privacy
Identity and access management
Examples of IAM and Amazon SQS policies
IAM policy attached to IAM user Bob
Allow
Actions:
ReceiveMessage, SendMessage
Resource:
arn:aws:sqs:us-east-1:80398EXAMPLE:MyQueue
Amazon SQS policy attached to MyQueue
Allow who:
Bob
Actions:
ReceiveMessage, SendMessage
Resource:
arn:aws:sqs:us-east-1:80398EXAMPLE:MyQueue
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
37
Equivalent permissions to MyQueue
Section 5 key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
38
Section 6: Introducing Amazon SNS
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SNS
Fully managed messaging service with pub/sub functionality for many-to-many messaging between distributed systems, microservices, and event-driven applications
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
40
Amazon Simple Notification Service (Amazon SNS)
Amazon SNS overview
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
41
SNS topic
Publisher
Subscribers
Endpoint types
Application-to-application messaging (A2A)
Lambda functions
SQS queues
Kinesis Data Firehose
HTTP(S)
Application-to-person messaging (A2P)
Text messaging (SMS)
Mobile push notifications
Publisher
Publisher
A topic acts as the logical access point
All messages are pushed to all subscriber endpoints
Publishers send messages�to a topic
Amazon SNS fanout pattern example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
42
Subscribers
Publisher
SNS topic
“new-order”
Ordering system
Data warehouse SQS queue
EC2 instance
Fulfillment SQS queue
EC2�instance
“new order-ABCD”
message
Order fulfillment application
Data warehouse application
DEV queue
Lambda function
Dev database
Image processing fanout example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
43
Source �S3 bucket
Destination �S3 bucket
User
SNS topic
SQS queue�Generate thumbnail
SQS queue�Size image for mobile
SQS queue�Size image for web
Lambda�functions
Section 7: Developing with Amazon SNS
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SNS message delivery lifecycle
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
45
SNS topic
Unavailable subscriber endpoint
A
A
Publisher
A
Return MessageID
Failed delivery
A
Retry per delivery policy
Dead-letter queue
A
Discard or send to dead-letter queue when retries are exhausted
Amazon SNS API operations
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
46
API operation | Description | Input | Output |
CreateTopic | Creates a topic |
|
|
Subscribe | Prepares to subscribe to an endpoint |
|
|
ConfirmSubscription | Verifies an endpoint owner's intent to receive messages |
| |
Publish | Sends a message to all of a topic's subscribed endpoints |
|
|
DeleteTopic | Deletes a topic and all of its subscriptions |
| |
Amazon SNS message filtering
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
47
Subscribers with filter policies
Ecommerce
website
Online buyer
SNS topic
Shopping
Events
SQS queue
Payment
Lambda
function�SearchIndex
Payment
gateway
Search
engine
event_type=
order_cancelled
event_type=
order_placed
event_type=
product_page_visited
Filter: �"event_type": [{"prefix": "order"}]
Filter:
"event_type": ["product_page_visited"]
Subscription filter policy example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
48
topic_arn = sns.create_topic(
Name=‘ShoppingEvents’
)['TopicArn'}
search_engine_subscription_arn = sns.subscribe(
TopicArn = topic_arn,
Protocol = 'lambda',
Endpoint = 'arn:aws:lambda:us-east-1:123456789012:function:SearchIndex'
)['SubscriptionArn']
sns.set_subscription_attributes(
SubscriptionArn = search_engine_subscription_arn,
AttributeName = 'FilterPolicy'
AttributeValue = '{"event_type": ["product_page_visited"]}'
)
SNS topic
Attribute in filter policy
Subscriber
Message with attributes example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
49
message = '{"product": {"id": 1251, "status": "in_stock"},'\
' "buyer": {"id":4454}}'
sns.publish(
TopicArn = topic_arn,
Subject = "Product Visited #1251",
Message = message,
MessageAttributes = {
'event_type': {
'DataType': 'String',
'StringValue': 'product_page_visited'
}
}
}
Message
Message attribute that matches the attribute in the filter policy
Three types of Amazon SNS security
IAM and Amazon SNS policies
Server-side encryption (SSE) with AWS KMS
Amazon VPC endpoint
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
50
Data encryption
Internetwork traffic privacy
Identity and access management
Demonstration: Working with Amazon Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
51
Sections 6 and 7 key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
52
Section 8: Introducing Kinesis Data Streams
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kinesis Data Streams
Fully managed, massively scalable and durable real-time data streaming service that you can use to ingest, buffer, and process streaming data in real time
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
54
Amazon Kinesis�Data Streams
Kinesis Data Streams use cases
Log and event data collection
Real-time analytics
Mobile data capture
Gaming data feed
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
55
Kinesis Data Streams overview
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
56
Kinesis data stream
Producer
Consumers
Producer
Producer
Put messages on the stream
The stream stores data durably distributed on shards
Custom application written with KCL deployed on Amazon EC2
Lambda/�Lambda function
Kinesis Data Firehose stream connected to a destination like Amazon S3
Kinesis Data Analytics application connected to another stream or a Lambda function
Poll the stream
Shard 1
Shard 2
Records are available during the retention period
Other Kinesis data streaming services
Amazon Kinesis Data Firehose
Amazon Kinesis Data Analytics
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
57
Kinesis Data Streams example
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
58
Amazon Kinesis
Data Streams
Amazon Kinesis
Data Firehose
Amazon Simple Storage Service (Amazon S3)
Amazon Elastic Compute Cloud (Amazon EC2)
AWS Lambda
Amazon Elastic Container Service
(Amazon ECS)
Amazon Kinesis
Data Analytics
Amazon Elasticsearch Service (Amazon ES)
Amazon Athena
Amazon CloudWatch
Kinesis API operations
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
59
Kinesis data stream
Producers
Consumers
Shard 1
Shard 2
CreateStream: Creates a stream. Requires ShardCount and StreamName.
DeleteStream: Deletes the named stream and all of its data shards.
DescribeStreamSummary: Provides summary information about a named stream.
UpdateShardcount: Modifies the number of shards on the stream.
MergeShards: Merges two shards to reduce the stream's capacity.
SplitShards: Splits a shard into two shards to increase the stream's capacity.
PutRecord/PutRecords: Writes a record or records to the stream. Includes a partition key that determines which shard the record(s) will be written to.
GetShardIterator: Gets the shard iterator, which tells you the shard position from which to start reading records.
GetRecords: Reads records from the stream, starting from a specified shard iterator.
Examples using the AWS CLI�for basic tasks
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
60
aws kinesis create-stream --stream-name MyStream --shard-count 1
aws kinesis describe-stream-summary --stream-name MyStream
aws kinesis put-record --stream-name MyStream --partition-key 123 --data testdata
Create a stream named MyStream with one shard
Check whether your new stream is ready to be used
Put a test record on the stream
Get the starting position to read the stream, then use the output value to get records
aws kinesis get-shard-iterator --shard-id shardId-000000000000 --shard-iterator-type TRIM_HORIZON --stream-name MyStream
aws kinesis get-records --shard-iterator AAAAAAAAAAHSywl…
Building producers and consumers
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
61
Feature | Kinesis Producer Library (KPL) | Kinesis Client Library (KCL) | Kinesis API with AWS SDK |
Abstracts stream management tasks so you can focus on application logic | ✔ | ✔ | |
Handles producer tasks such as writing with automatic retries and aggregating records to optimize throughput | ✔ | | |
Handles consumer subtasks such as load balancing and checkpointing processed records | | ✔ | |
Provides the ability to write producer or consumer applications using direct interaction with the Kinesis API | | | ✔ |
Requires your application code to handle stream management | | | ✔ |
Comparison of queues and streams
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
62
| Queues | Streams |
Data value | The value comes from processing individual messages. | The value comes from aggregating messages to get actionable data. |
Message rate | The message rate is variable. | The message rate is continuous and high volume. |
Message processing | Messages are deleted after a consumer successfully processes them. | Messages are available to multiple consumers to process in parallel, and each consumer maintains a pointer but does not delete records. |
Example use cases | Financial transactions, product orders | Clickstream data, application logs |
Section 8 key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
63
Lab 10.1: �Implementing a Messaging System Using Amazon SNS and Amazon SQS��
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
64
Lab: Tasks
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
65
Lab: Final product
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
66
Elastic Beanstalk deployment
Coffee suppliers application
Aurora Serverless
database
Coffee suppliers
send inventory updates
Amazon SNS�topic
Amazon SQS�queue
Amazon SQS�dead-letter queue
Begin Lab 10.1: Implementing a Messaging System Using Amazon SNS and Amazon SQS
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
67
~ 90 minutes
Lab debrief: �Key takeaways
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
68
Module wrap-up
Module 10: Developing with Messaging Services
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module summary
In summary, in this module, you learned how to do the following:
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
70
Complete the knowledge check
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
71
Sample exam question
A developer wants to introduce an asynchronous connection in their application workflow that processes individual banking transactions including deposits and withdrawals. Transactions must be handled in the order they arrive. Which method would meet the developer's needs?
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
72
Thank you
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited. Corrections, feedback, or other questions? Contact us at https://support.aws.amazon.com/#/contacts/aws-training. All trademarks are the property of their owners.
Messaging services as part of developing a cloud application
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
74
Step Functions �retrieves data from RDS and posts report to S3 with presigned URL
Amazon Cognito provides token for report requests
Amazon S3�
Developers
AWS Cloud9
CloudShell
AWS CLI
SDK for Python
Console
�bucket hosts café website
Café website users
Webpage �requests
Bucket policy
DynamoDB database stores products table
API Gateway REST API
Lambda function �does database lookups
Café employees
Elastic Beanstalk
ECR hosts Docker image
EC2 instance with Docker container runs coffee supplier website
Aurora Serverless on RDS stores supplier database
AWS WAF �secures API endpoint
Café employees
Refresh cache per settings
CloudFront distribution
ElastiCache �for Memcached
AWS WAF �secures website
SNS
SQS
Suppliers
Coffee inventory
updates
Lambda