AWS SAA Exam: SQS, SNS, and SWF Practice Questions
Which is best for decoupling jobs that require processing on EC2 instances which typically complete in minutes or hours?
A. Since no human work was mentioned, and the tasks are done by ec2 instances in minutes or hours, this sounds like a job for SQS.
Which is best for handling a sequence of activities that may take several days to complete?
C. SWF - tasks can be completed within a year. SQS retains messages for up to 14 days at max.
SNS is not ideal for handling tasks, but rather for sending/receiving notifications, or for pub/sub architectures
that need to send same message to multiple receiving entities (such as SQS queues).
True/False. SWF tasks may occasionally be delivered twice.
False. While this may happen with SQS standard queues, SWF tasks are assigned only once and never duplicated.
In SWF, what is a domain?
A collection of related workflows.
You are noticing an SQS message from a fifo queue being processed several times. What might be the cause of this?
Select all that apply.
A. It is normal for fifo queues to occasionally deliver a message more than once
B. If the message was put into the queue twice without content-based deduplication or deduplication id, it would be delivered twice
C. The default visibility timeout may have expired.
A is incorrect because while standard queues may sometimes introduce duplicate messages, fifo queues do not introduce duplicates.
B and C are correct. Ensure you have a strategy for deduplication such as content-based deduplication.
Check if the default visibility timeout has expired by looking at the time difference between when duplicates are received.
You can increase the default visibility timeout, or when calling receivemessage and intending to only process larger jobs,
you may specify a higher default visibility timeout. A receipt handle is provided when receiving the message. Calling DeleteMessage,
you can provide this receipt handle.
A group of ec2 instances for 3D video rendering pulls jobs from an sqs queue.
The queue is usually empty but occasionally receives several messages at one time. How can
we reduce costs?
Switch to long polling, and call deletemessage in batch.
True/False after ReceiveMessage call is made to SQS, the message is returned and deleted from the queue
False, the message is only deleted using the DeleteMessage action after SQS is informed that the message has been fully processed
Using short polling on an sqs queue, you requested 10 messages but only received 2, why is this?
Yes. If number of messages in queue is under 1,000, you may get fewer messages than you requested
with short polling.
T/F SQS can trigger a lambda function
T/F SNS supports CloudTrail
True. You can log all API requests to SNS.
You need to send only a critical subset of SNS messages to text your on-call
engineer. How should you do this?
Use SNS message filtering.
True/False - SNS messages are stored redundantly across regions
False, they are stored across AZs in a region
True/False - SNS can send json or xml emails, text messages, and push notifications to mobile devices
False. It can do all of these except send xml emails. This is not a full list of
subscription types. See https://docs.aws.amazon.com/sns/latest/dg/sns-create-subscribe-endpoint-to-topic.html for a full list.