SQS / SWF / SNS / MQ / MSK / Kinesis
SQS (Simple Queue Service)
- To de-couple your infrastructure
- Pull-based
- Message are 256KB in size
- Message kept in queue for 1min to 14days
- Standard SQS:
- 至少交付一次,可能會重複
- 保持高效率,沒有保證順序
- FIFO SQS:
- Visibility Time
- Timeout設定,超過這個時間沒處理完,message會讓其他人有機會consume
- 是造成重複遞送的主因
- Max to 12hr
- 如果job要做很久,把Visibility Time提高,讓EC2 / Lambda有更多時間把事做完
- Polling
- Short Polling: 即使沒訊息也會return
- Long Polling: 等到有訊息,或polling timeout才會return
- 省錢有幾個方法:
- 改用long-polling
- 降低message size
SNS (Simple Notification Service)
- Push-based message service
- 可以將資料送進SQS Standard
SWF (Simple Workflow Service)
- Workflow executions
- 可以存放到1 year
- 提供Task-Oriented API
- 會確保assigned task不會重複執行
- 分三個角色
- Starters: 啟動job的
- Deciders: 控制下一步要幹嘛,決定是成功還是失敗
- Activity Workers: 執行Task
Elastic Transcoder
SMS (Short Message Service)
SES (Simple Email Service)
Amazon MQ
AWS MSK
AWS Kinesis