AWS SQS Flashcards
What is SQS?
It is a managed message queue.
What is SQS used for?
- Distributed and decoupling applications
- Buffering incoming load, so slower services like a database can deal with the write load more evenly.
What is the max size of a message?
- 256K
How can we store large amounts of data?
- Store the data in S3 and reference it in the SQS message.
What options have I for receiving messages from SQL, can I have SQL push messages to me?
No, there is no push methods available form SQL, you have to use long or short poll methods to get a message from SQS.
What is the difference between long and short poll?
- Long poll means when you make a call to SQL the call will not return until the number of messages specified in the call are available or the time out occurs.
- Short pool means it will return if there is no messages available
What types of SQS queues are available?
- Standard queue
- FIFO queue
What is the difference between FIFO and standard queues?
Standard queues have infinite capacity, messages are not guaranteed to be delivered just once, messages are not guaranteed to be delivered in order.
- FIFO queues have a limited capacity, guarantee message order and only one comply of the message will be delivered.
What is the capacity of FIFO queue?
300 messages per sec for single messages and 3K mps for batched messages.
I have an SNS topic, is it possible to have messages delivered to an SQL queue?
Yes, SNS supports SQS as an endpoint.
Explain what the visibility time out is?
The visibility time out is the amount of time a message stays invisible after it is received by a consumer if the consumer does not delete the message from the SQS queue before the visibility time out expires the message will become visible on the SQS queue and another consumer can consume it.
How long can I have a long poll for?
1 - 20 seconds
Are messages retained for a period and what is the period?
Default is 4 days and max is 14 days
I would like to move away from using EC2 instances for processing SQS messages, what options do I have?
You can now use Lambda, in the model Lambda is automatically invoked to process the message in the SQS queue, this is no need to poll.
I have a solution thet has EC2 instances thet process messages, I wnat to make this solution more dynamic and have the number of EC2 instances be elastic and grow and shrink based on the number of messages in the SQS queue, how can this solution be modified?
Create an autoscaling group and set it scaling policy to use cloud watch alarms, we also set up cloudwatch alarms to trigger on the number of messages in the SQS queue.