Learning Objectives:
- Understand key messaging use cases, including service-to-service communication, asynchronous work item backlog, and state change notifications
- Learn how to get started using message queues and topics with just a few simple APIs, and quickly integrate with other AWS services
- Hear how customers, like Capital One, are benefiting from migrating applications to a fully managed messaging solution in the cloud
Small startups to the biggest global enterprises are designing applications using microservices and distributed architecture to improve resiliency and scale faster. AWS messaging services and Amazon Simple Queue Service (SQS) and Amazon Simple Notification Service (SNS) and make it easy to decouple communication between software components and build modern applications that are fault-tolerant and easy to scale. Messaging is a key part of Amazon’s own e-commerce platform architecture, and used in mission-critical backend systems such as Amazon Retail Ordering workflow. In this session, we will show how you can use Amazon SQS and Amazon SNS fully managed messaging to decouple your application architecture, enable asynchronous communication between different services, and eliminate the pain associated with operating dedicated messaging software and infrastructure. We will demonstrate common messaging design patterns for building reliable and scalable applications in the cloud.
26. Improving Synchronous Latency
Booking takes up to 3 seconds, it’s too slow!
Let’s break it down:
Change status in database 30 ms
Notify external booking supplier 800 ms
Prepare a PDF invoice 900 ms
Send a confirmation e-mail with large PDF 500 ms
27. Use Background Thread
Synchronous:
Background thread:
Change status in database 30 ms
Notify external booking supplier 800 ms
Prepare a PDF invoice 900 ms
Send a confirmation e-mail with large PDF 500 ms
28. Use Background Thread
Synchronous:
Background thread:
Work can get lost!
Change status in database 30 ms
Notify external booking supplier 800 ms
Prepare a PDF invoice 900 ms
Send a confirmation e-mail with large PDF 500 ms
29. Safe Asynchronous Tasks
Synchronous:
Background poller:
Change status in database 30 ms
Store task in queue 10 ms
Get next task from queue 10 ms
Notify external booking supplier 800 ms
Prepare a PDF invoice 900 ms
Send a confirmation e-mail with large PDF 500 ms
Delete task from queue 10 ms
33. Notify Everyone!
Booking service
Email notification service
External partner integration service
Financial ledger queue
Payment processing service
New booking
completed!
34. Notify Everyone!
Booking service
Email notification service
External partner integration service
Financial ledger queue
Payment processing service
New booking
completed!
35. Decouple by Publishing Event through SNS
Booking service Booking topic
Email notification service
External partner integration service
Financial ledger queue
Payment processing service
36. Decouple by Publishing Event through SNS
Booking service Booking topic
Email notification service
External partner integration service
Financial ledger queue
Payment processing service
New booking
completed!
37. Decouple by Publishing Event through SNS
Booking service Booking topic
Email notification service
External partner integration service
Financial ledger queue
Payment processing service
39. There’s more! Queues in SQS
Long polling:
instant push
deliveries of
messages
Server side
encryption
40. There’s more! Queues in SQS
Long polling:
instant push
deliveries of
messages
Server side
encryption
Dead letter
queues
41. There’s more! Queues in SQS
Long polling:
instant push
deliveries of
messages
Server side
encryption
Dead letter
queues
Easy monitoring
with CloudWatch,
with alarming
42. There’s more! Queues in SQS
Long polling:
instant push
deliveries of
messages
Server side
encryption
Dead letter
queues
Easy monitoring
with CloudWatch,
with alarming
Integrated with
other AWS
services as a
destination
44. There’s more! Pub/Sub messaging in SNS
Multiple
transports
Customizable
delivery retries for
HTTP
45. There’s more! Pub/Sub messaging in SNS
Multiple
transports
Customizable
delivery retries for
HTTP
Failure
notifications
46. There’s more! Pub/Sub messaging in SNS
Multiple
transports
Customizable
delivery retries for
HTTP
Failure
notifications
Easy monitoring
with CloudWatch,
with alarming
47. There’s more! Pub/Sub messaging in SNS
Multiple
transports
Customizable
delivery retries for
HTTP
Failure
notifications
Easy monitoring
with CloudWatch,
with alarming
Integrated with
other AWS
services as a
destination