SQS, SNS, EventBridge, Step Functions: giao tiếp giữa các thành phầnSQS, SNS, EventBridge, Step Functions: communication between components
Bài học trình bày cách kết nối các dịch vụ của MFTECH (đặt hàng, thanh toán, kho, email, phân tích) bằng cơ chế truyền message: hấp thụ tải đột biến khi flash sale mà không mất đơn hàng, cô lập message lỗi để không gây tắc nghẽn hệ thống, đảm bảo thứ tự và tính duy nhất cho giao dịch ví điện tử, và định tuyến mỗi sự kiện tới đúng các thành phần cần nhận.This lesson shows how to connect MFTECH's services (ordering, payment, inventory, email, analytics) through messaging: absorbing flash-sale traffic spikes without losing orders, isolating failed messages so they do not clog the system, guaranteeing ordering and uniqueness for e-wallet transactions, and routing each event to exactly the components that need it.
- Mức độ
- Quan trọng Được sử dụng phổ biến trong nhiều mẫu kiến trúc
- Kiến thức tiên quyết
- Lambda + API GatewayAuto Scaling (ASG)
- Thời lượng
- ~30 phút, 5 phần học có mô phỏng
Ở giai đoạn đầu, ứng dụng web của MFTECH gọi đồng bộ tới mọi thành phần: sau khi tạo đơn hàng, ứng dụng lần lượt gọi dịch vụ thanh toán, dịch vụ kho, dịch vụ email và chờ từng phản hồi. Hiện hệ thống tổ chức flash sale hằng tuần và gồm hàng chục dịch vụ; một thành phần chậm làm tăng độ trễ của toàn bộ chuỗi, một thành phần lỗi làm đơn hàng thất bại. Giải pháp là để các thành phần giao tiếp bất đồng bộ qua message thay vì gọi đồng bộ và chờ phản hồi.
In its early days, MFTECH’s web application called every component synchronously: after creating an order, the application called the payment service, the inventory service and the email service in turn and waited for each response. The system now runs a weekly flash sale and consists of dozens of services; one slow component increases the latency of the whole chain, and one failed component makes the order fail. The solution is for components to communicate asynchronously through messages instead of calling synchronously and waiting for a response.
Các phần của bài học
Kiến thức
5 phần học, đọc theo thứ tự- Phần 1/5Part 1/5 · 5 phút Đã đọc ✓ Đang đọc Decoupling hai tầng ứng dụng bằng Amazon SQS queueDecoupling two application tiers with an Amazon SQS queue
- Phần 2/5Part 2/5 · 6 phút Đã đọc ✓ Đang đọc Vòng đời message trong Amazon SQS queueMessage lifecycle in an Amazon SQS queue
- Phần 3/5Part 3/5 · 8 phút Đã đọc ✓ Đang đọc Amazon SQS FIFO queueAmazon SQS FIFO queues thứ tự message và exactly-once processingmessage ordering and exactly-once processing
- Phần 4/5Part 4/5 · 7 phút Đã đọc ✓ Đang đọc Fan-out (SNS), event routing (EventBridge) và workflow orchestration (Step Functions)Fan-out (SNS), event routing (EventBridge) and workflow orchestration (Step Functions)
- Phần 5/5Part 5/5 · 4 phút Đã đọc ✓ Đang đọc So sánh delivery guarantee và các tham số cấu hình dễ nhầm lẫnComparing delivery guarantees and easily confused configuration settings
Bài kiểm tra
tự đánh giá trước khi sang bài sauCác bài tiếp theo trong lộ trình học
Bài học tiếp theo
Tài liệu AWS
Xem thêm 24 tài liệu
- Amazon SQS short and long polling
- Scaling policy based on Amazon SQS
- What is Amazon SNS?
- What is Amazon EventBridge?
- What is AWS Step Functions?
- What is Amazon MQ?
- Amazon SQS message quotas
- Amazon SQS temporary queues
- Understanding and managing Amazon S3 storage classes
- acm-certificate-expiration-check (AWS Config)
- Application Integration (Overview of Amazon Web Services)
- Amazon SQS message timers
- Amazon SQS delay queues
- Amazon SQS standard queues
- Exactly-once processing in Amazon SQS
- How EventBridge retries delivering events
- Troubleshooting Amazon EventBridge
- Introducing enhanced custom event buses in Amazon EventBridge (AWS News Blog)
- Amazon SQS, Amazon SNS, or Amazon EventBridge? (AWS Decision Guide)
- Amazon SNS message delivery retries
- Amazon SNS dead-letter queues
- Amazon SNS message archiving for FIFO topic owners
- Change the data retention period (Kinesis Data Streams)
- Using Lambda with Kinesis Data Streams
Xem thêm 24 tài liệu
- Amazon SQS short and long polling
- Scaling policy based on Amazon SQS
- What is Amazon SNS?
- What is Amazon EventBridge?
- What is AWS Step Functions?
- What is Amazon MQ?
- Amazon SQS message quotas
- Amazon SQS temporary queues
- Understanding and managing Amazon S3 storage classes
- acm-certificate-expiration-check (AWS Config)
- Application Integration (Overview of Amazon Web Services)
- Amazon SQS message timers
- Amazon SQS delay queues
- Amazon SQS standard queues
- Exactly-once processing in Amazon SQS
- How EventBridge retries delivering events
- Troubleshooting Amazon EventBridge
- Introducing enhanced custom event buses in Amazon EventBridge (AWS News Blog)
- Amazon SQS, Amazon SNS, or Amazon EventBridge? (AWS Decision Guide)
- Amazon SNS message delivery retries
- Amazon SNS dead-letter queues
- Amazon SNS message archiving for FIFO topic owners
- Change the data retention period (Kinesis Data Streams)
- Using Lambda with Kinesis Data Streams