You are developing an application that will be comprised of the following architecture - 1
A set of EC2 instances to process the messages. 2
These (EC2 instances) will be spun up by an Autoscaling group. 3
SQS Queues to maintain the processing messages. 4
There will be 2 pricing tiers. How will you ensure that the premium customers' messages are given more preference?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - C.
The ideal option would be to create 2 SQS queues.
Messages can then be processed by the application from the high priority queue first.
Option A is incorrect because 2 Auto Scaling groups will still launch the same set of EC2 instances that are defined in the Launch Configuration/Template.
Option B is incorrect because launching 2 sets of EC2 instances involves lots of manual work.
Option D is incorrect because having 2 ELB will still require a different set of EC2 instances.
For more information on SQS, please refer to the below Link-
https://aws.amazon.com/sqs/The correct answer is C. Create 2 SQS queues, one for normal and one for premium customers.
Explanation:
To ensure that premium customers' messages are given more preference, we need to create separate SQS queues for normal and premium customers. This approach is known as queue-based load leveling.
When a message is sent to a queue, it is stored there until it is consumed by a consumer. In this architecture, EC2 instances act as consumers that process messages from the queue.
To ensure that premium customers' messages are given more preference, we can set up a priority queue. Priority queues ensure that messages with higher priority are processed first. In this case, premium customers' messages would have a higher priority than normal customers' messages.
We can also set up different polling rates for the two queues. For example, we can set a lower polling rate for the normal queue and a higher polling rate for the premium queue. This ensures that messages in the premium queue are processed more quickly.
Creating separate Autoscaling groups or EC2 instances would not be an efficient approach as it would increase the complexity and cost of the architecture. Creating separate Elastic Load Balancers would also not be an effective approach as they are used for distributing traffic and not for managing queues.