[SAA + SAP] 21. SQS

SAA

  • Max retention days 14 days
  • Max size 256 KB

  • Cross Account Access
  • S3 push notification 

  • MaximumReceive API
  • Set threshold

  • Request Queue
  • Response Queues for each request (2 requests, then create 2 response queues)
  • SQS Temporary Queue Client

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-temporary-queues.html

 

FIFO Queue

When creating a FIFI queue, Queue name should end with `.fifo`

Has GroupID and Deduplication ID

 

  • Need to create a Custom Metric
  • Queue length: ApproximateNumberOfMessages

 

SAP

  • SQS can be used as a write buffer for DynamoDB
    • Because SQS auto-scale
    • write an application to read from SQS then insert to DynamoDB
    • to prevent PrevisionThroughtExpection error

  • SQS might be processed twice
  • Need to make sure consumer is idempotency
  • For example, two EC2 happens to handle the same SQS message
  • Then need to insert data to DynamoDB
  • this is not idempotent, because two record will be the same
  • Instead, we can upsert into DynamoDB based on primary key
  • so that, two operations are still idempotency

idempotency is a Web API design principle defined as the ability to apply the same operation multiple times without changing the result beyond the first try.

 

Upsert: An operation that inserts rows into a database table if they do not already exist, or updates them if they do.

 

  • Lambda read 10 message in batch
  • Using long polling for efficiency
  • DLQ should be set only on SQS side
  • Invoke DLQ is async, because Lambda doesn't need response from DLQ
  • Use Lambda destination
  • 6x the timeout of your Lambda function

Kinesis and SQS FIFO are both in order, but FIFO only can process 3,000 messages per second

 

 

Idempotent need to be handeld in application side

 

posted @   Zhentiw  阅读(273)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2020-08-07 [XState] Parallel State and deep history state
2019-08-07 [Javascript] Create an Image with JavaScript Using Fetch and URL.createObjectURL
2019-08-07 [Flutter] Stack Layout
2019-08-07 [Algorithm] Find midpoint
2017-08-07 [D3] Create Chart Axes with D3 v4
2017-08-07 [D3] Margin Convention with D3 v4
2017-08-07 [D3] Better Code Organization with selection.call() with D3 v4
点击右上角即可分享
微信分享提示