Applications Flashcards
SQS - Simple Queuing system
gives access to a message queue that can store messages while waiting for a computer to process them
Allows you to decouple the components of an app so they run independently
Messages can contain up to 256kb of text in any format
SQS queue types
Standard
FIFO
Standard queue type
default queue type
allows for nearly unlimited # of transactions per second
guarantee a message is delivered at least once
- may be delivered out of order
- may be delivered more than once
best effort ordering
FIFO queue
exactly once processing
sent order of messages preserved
limited to 300 transactions per second
SQS pull vs push
SQS is pull based, you need an EC2 instance pulling messages from the queue
SQS message retention period
1 minute to 14 days
default: 4 days
Visibility timeout
amount of time message is ‘invisible’ in queue after a reader picks up the message
If job is processed before timeout, job is deleted from queue. If not, it becomes visible and another reader will process it
timeout max: 12 hours
SQS long vs short polling
long polling: will wait until there is something to pull from the queue or timeout is reached
short polling: will return immediately, even if queue is empty
SWF - Simple workflow services
Way of coordinating work across distributed app components
tasks = invocations of processing steps that can be performed by code, web service calls, human actions, and scripts
SWF vs SQS
If there is human interaction -> use SWF
max retention period:
- SQS = 14 days
- SWF = 1 year
API
- SQS = message oriented
- SWF = task oriented
SQS = handle duplicated messages and ensure message only processed once SWF = task assigned only once and Never duplicated
SWF = keeps track of all tasks and events in an app SQS = need to implement own app-level tracking
SWF actors
workflow starter - app that can start a workflow
deciders - control the activity tasks in a workflow execution
activity workers - carry out the activity tasks
SNS - Simple notification service
makes it easy to set up, operate, and send notifications from the cloud
publishes messages from an app and immediately deliver them to subscribers or other apps
instant push-based delivery
SNS notification delivery
direct to mobile devices
via SMS or email to SQS queues or any HTTP endpoint
SNS topic
An access point for allowing recipients to subscribe for identical copies of the same notification
SNS vs SQS
both are messaging systems in AWS
SNS = push SQS = pull/poll