Amazon SQS SNS SWF
|
October 29, 2017
|
Development,
AWS
Simple Queue Service SQS
- fast, reliable, scalable and fully manged message queuing service
- used to decouple the components of a cloud application
- ensures delivery of each message at least once and supports multiple reader and writers interacting with the same queue
- design system to be idempotent. This way if your system does ingest a message more than once, it will not have an adverse affect
- SQS does not guarantee First IN First Out (FIFO)
Message Lifecycle
- message A is sent to queue
- message A is retrieved from the queue and the visibility timeout period starts
- message A is processed and is deleted from the queue during the visibility timeout period
- Queue URLs
- message IDs
- receipt handles
Long Polling
- to prevent rapid cycle of requests you can set Long Polling. If no message is in the queue then the call will wait (WaitTimeSeconds) for one to appear up to 20 seconds.
- reduces load on the client
Simple Workflow Service SWF
- coordinating work across distributed components
- implement distributed asynchronous applications as work flows
- Domains scope resources within the AWS account. Workflows in different domains cannot interact with each other
- Workflow history is every event that happened in the workflow
Actors
a number of different types of programmatic features
- start: any applications that the workflow executes
- decider: logic that coordinates the tasks and provides input data to the activity workers (uses Long Polling)
- activity worker: a single computer process (or thread) that performs the activity tasks in your workflow (use Long Polling)
Tasks
- activity tasks: tells an activity worker to perform its function
- AWS Lambda task: executes an AWS Lambda function instead of a traditional SWF
- decision task: tells a decider that a state of the workflow execution has changed so that the decider can determine the next activity that needs to be performed
Simple Notification Service SNS
- to setup, operate and send notifications
- uses publish-subscribe messaging
- delivered using a push mechanism
- publishers
- subscribers
