01 - SQS Flashcards Preview

AWS-CDA-2019-08 - Other Services > 01 - SQS > Flashcards

Flashcards in 01 - SQS Deck (9):
1

Amazon Simple Queue Service (SQS) - Overview

Amazon Simple Queue Service (SQS)

  • Oldest AWS Service
  • SQS is a distributed message queueing system
  • Allows you to decouple the components of an application so that they are independent
  • SQS is pull based, not pushed based system
  • Messages are 256 KB in size
  • Visibility time out is 12 hours
  • Messages can be kept in the queue from 1 minute to 14 days. The default is 4 days.
  • SQS guarantees messages will be processed at least once
  • Visibility timeout is the amount of time that the message is invisible in the SQS queue after a reader picks up that message.
    • If message processed before timeout expires, it is deleted from queue
    • If message not processed before timeout expires, it will become visible again to be-processed (this could result in the same message being delivered twice)
  • Visibility time out is maximum of 12 hours
  • Queues can either be standard or FIFO

2

SQS Delivery

SQS Delivery

  • SQS messages can be delivered multiple times in any order when using the standard queue 
  • To control priority processing, setup multiple queues and configure application to poll high priority queue first, then low priority queue if no items found

3

Default Visibility Time Out

Default Visibility Time Out

  • Default visibility time out is 30 seconds
  • Max visibility time out is 12 hours

4

Two Types of Polling

Two Types of Polling

  • Short Polling
  • Long Polling

5

Short Polling

Short Polling

  • With the traditional SQS Short Polling, responses are returned immediately even if the queue being polled is empty

 

6

Long Polling

Long Polling

  • SQS Long Polling does not return a response until a message arrives in the queue, or the long poll times out
  • Requestor will wait for a response for as long as the long poll time out period is set
  • If message arrives during the long poll time out interval it is returned immediately 
  • Maximum Long Poll Time Out = 20 seconds
  • Long polling saves money

7

Two Types of Queues

Two Types of Queues

  • Standard Queues (default)
  • FIFO Queues (First In First Out) High Throughput

8

Standard Queues

Standard Queues (default)

  • Unlimited Throughput
    • can support unlimited number of transactions per second
  • At Least Once Delivery
    • guarantees a message is delivered at least once (and possibly more than once or out of order).
  • Best Effort Ordering
    • occasionally messages may be delivered in an order different from what they were sent
    • The application must place sequencing information in each message so that they can reorder messages, if required

9

FIFO Queues

FIFO Queues (First In First Out) 

  • High Throughput
    • 3,000 messages a second with batching
    • 300 messages a second without batching
  • Exactly Once Processing
    • message delivered once
    • remains available until it is processed and deleted
    • duplicates are not introduced into the queue 
  • First In First Out Delivery (FIFO)
    • the order the messages sent and received strictly preserved