AWS Simple Queue Service (SQS)

  1. AWS SQS is a web service that provides us with a message queue on the cloud to which a sender process (not humans) can send a message and another reader process (not humans) can retrieve/process/delete the message.
    1. So message queue is basically a temporary repository of messages on the AWS cloud.
  2. SQS is asynchronous. Processes are  decoupled (or loosely coupled), distributed, hence highly elastic and scalable.
  3. SQS is pull based system (unlike SNS which is push based). One or more reader programs/lambdas/EC2s can pull messages. You can setup auto scaling to add/remove pulling EC2 instances based on the size the queue.
  4. Messages can be 256 KB max. Text only. You can ASCII encode if you need to send binary files.
  5. Two types of queues:
    1. Standard queues:
      1. No order is maintained.
      2. Messages are guaranteed to be sent at-least once. Some rare occasions they are sent twice or more. You need to architect keeping this in mind.
    2. FIFO queues:
      1. Order of messages is maintained.
      2. Messages are guaranteed to be sent only once.
      3. Multiple ordered messages groups can be hosted in a single queue.
      4. Max 300 transactions per sec.
  6. Messages can be kept in the queue from 1 min to 14 days. Default is 4 days.
  7. Visibility Timeout (VT) of a message is the amount of time it will be invisible in the queue after a reader pulls that message.
    1. Max VT is 12 hours.
    2. After timeout expires, the message will be automatically visible again in the queue. So its the responsibility of the reader to delete the message after processing.
    3. Also make sure message processing is finished before the VT or else you as an architect need to increase the visibility timeout.
  8. Two types of polling possible by the reader
    1. Short polling returns immediately. So it could be expensive if the queue is sparse.
    2. long polling returns only when a message is available in the queue or the long polling timeout whichever is earliest.
<<< ElasticacheAWS Simple Workflow Service (SWS) >>>
Copyright 2005-2016 KnowledgeHills. Privacy Policy. Contact .