Your application provides data transformation services. Files containing data to be transformed are first
uploaded to Amazon S3 and then transformed by a fleet of spot EC2 instances. Files submitted by your
premium customers must be transformed with the highest priority. How should you implement such a system?
A.
Use a DynamoDB table with an attribute defining the priority level. Transformation instances will scan the
table for tasks, sorting the results by priority level.
B.
Use Route 53 latency based-routing to send high priority tasks to the closest transformation instances.
C.
Use two SQS queues, one for high priority messages, the other for default priority. Transformation instances
first poll the high priority queue; if there is no message, they poll the default priority queue.
D.
Use a single SQS queue. Each message contains the priority level. Transformation instances poll high-priority
messages first.
Explanation:
C
C
Based on some related discussions here:
https://forums.aws.amazon.com/thread.jspa?threadID=48134
D
C is wrong because SQS does NOT guaranty priority. And 2 SQS also do NOT guaranty priority. You must include priority information inside the message itself.
Sorry, guys.
D seems to be wrong. Instances can not poll high-priority messages first, they just poll and can determine priority only after message receiving.
Why not A? (I still have some doubts about C, A should work)
THere are different queues for different priorities. SQS doesn’t decide this. C is correct
The best answer is C b/c it is faster than A.
C
Correct answer is B
B is not the right answer because transformation instances are not running all the time since they are spot instances.
C is a good option, however you need to take SQS message retention into account:
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MessageLifecycle.html
“SQS automatically deletes messages that have been in a queue for more than maximum message retention period. The default message retention period is 4 days. However, you can set the message retention period to a value from 60 seconds to 1209600 seconds (14 days) with SetQueueAttributes.”
C is correct
C
The application takes care of priority of each queue.
SQS priority queues:
http://awsmedia.s3.amazonaws.com/pdf/queues.pdf
also:
Priority: Use separate queues to provide prioritization of work.
https://aws.amazon.com/sqs/details/
C is the right answer
Work Queues: Decouple components of a distributed application that may not all process the same amount of work simultaneously.
Buffer and Batch Operations: Add scalability and reliability to your architecture, and smooth out temporary volume spikes without losing messages or increasing latency.
Request Offloading: Move slow operations off of interactive request paths by enqueing the request.
Fanout: Combine SQS with Simple Notification Service (SNS) to send identical copies of a message to multiple queues in parallel.
Priority: Use separate queues to provide prioritization of work.
Scalability: Because message queues decouple your processes, it’s easy to scale up the send or receive rate of messages – simply add another process.
Resiliency: When part of your system fails, it doesn’t need to take the entire system down. Message queues decouple components of your system, so if a process that is reading messages from the queue fails, messages can still be added to the queue to be processed when the system recovers.
C is ther correct answer