Application Services - SQS Flashcards
What is SQS?
web service that allows you to access a message queue that can be used to store messages while waiting for a computer to process them.
distributed queue system that enables web services apps to quickly and reliably queue messages that one component in the app generates to be consumed by another component
What is a queue?
temporary repository for messages that are awaiting processing
Example:
Image is uploaded to web app, web app alerts SQS that image has been uploaded and a job needs to be executed on it. app servers may queue SQS system and notice new job that comes in and access that image and perform a task. app servers will update queue and remove message from the queue
What is meant by decoupling/loosely coupling in SQS?
If web server goes down, for example, message is still in SQS and app servers not affected
T/F: Using SQS, you can decouple the components of an app so they run independently, with SQS easing message management between components.
True
Can any component of a distributed app store messages in a fail-safe queue?
Yes
How much text can be contained in a message?
256 KB, any format
How can a component retrieve messages?
with the SQS API
The queue acts as
a buffer between the component producing and saving data and the component receiving the data for processing.
The queue resolves…
…issues that arise if the producer is producing work faster than the consumer can process it, or if the producer or consumer are only intermittently connected to the network
How many times does SQS deliver each message?
at least once
How many readers and writers can interact with the same queue?
multiple
How many components can a single queue interact with?
Many, simultaneously.
Do components need to coordinate with each other to share the queue?
No
SQS is engineered to
always be available and deliver messages
Does SQS guarantee first in first out delivery?
No
Is order important?
No, but you can place sequencing information in each message.
Is SQS pull or push?
pull
visibility timeout
how long message will be visible in the queue
when does visibility timeout start?
when app server picks up the message
when would a message be processed/deleted?
during visibility timeout period
what happens if visibility timeout expires?
message will stay in queue and won’t be deleted and another app server will pull it
T/F: SQS can be integrated with Auto Scaling
True. Useful for when queue gets too large and more app servers can spin up
max visibility timeout period
12 hours
Best design practice
design system so that processing a message more than once does not create errors/inconsistencies
How is message billing based?
64 kb chunks. each chunk billed as one request
Cost for requests per month
First 1M free, after that it’s 50 cents per million requests
How many messages can a request have?
Minimum 1 message, maximum 10 messages, up to maximum 256 kb