Simple Queue Service Flashcards

1
Q

Why to use SQS?

A
Traffic control(my understanding);
Decoupling application processes.
Application scalability;
Guaranteed message delivery;
Message order guarantee;
Asynchronous data processing;
Building resilience in the system;
Bring elasticity to application;
analyzing data flow and performance of the processes.
Building redundancy with SQS;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Main Features of SQS

A

redundant infrastructure: at least once and FIFO message delivered at least once and exactly once.
Multiple producers and consumers.
Queue wise configurable settings.
Variable message size. maximum 256KB. if need larger size, store it in S3 or DynamoDB. SQS holds the pointer to the S3 object in the queue.
Queue access control.
Delay queue:
Payment Card industry compliance.
Health Insurance Portability and Accountability Act compliance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Types of Queue

A

Standard Queues and FIFO queues.
Standard Queue: The Order may change; available in all QWS regions. supports almost all unlimited number of TPS with each API action. message may be delivered more than once. used when throughput is more importance than order.
FIFO: order is fixed. available only in US East, US West, EU(Ireland). supports limited throughput. up to 300 messages per second without any batching. with batch size of 10 messages, it can support up to 3000 messages per second. message delivered exactly once. when order is more important than the throughput. ending with .fifo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Dead Letter Queue

A

for storing failed messages.
The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Queue Attributes

A

Default visibility Timeout: 12 hours the length of time that a message is received from a queue will be invisible to other receiving components.
Message Retention Period: 1 minute – 14 days
Maximum Message Size: 256KB
Delivery Delay: 0-15 minutes
Receive Message wait time: 0-20 seconds – if set to a value > 0, long polling is enabled.
Content-Based Deduplication:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SQS Limits

A

In flight messages per queue – queue – standard: maximum 120,000 inflight messages; FIFO: 20,000. returns overLimit error if exceeded.
Queue Name – queue – max 80 characters(hyphen and underscore are OK).
Message attributes – 10 metadata attributes
Message Batch – 10 messages per batch
Message content – XML, JSON, and any unformatted text.
Message retention – min – 1 minute – 14 days, default is 4 days.
message size – min: 1 byte; max: 256KB
message visibility timeout – max 12 hours
policy information – max: 8192 bytes, 20 statements, 50 principals, or 10 conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SQS vs SNS

A

pulling vs pushing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

message Lifecycle

A

component 1 sends message A to a queue, and then the message is redundantly distributed across SQS servers;

  1. when component 2 is ready, it retrieves the message from SQS. while message A is being processed, it remains in the queue but is not returned to any subsequent request for the duration of the visibility timeout.
  2. component 2 deletes the message from the queue during that visibility timeout, or else it will get processed again.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

visibility time out

A

used to block other components from processing a message.

can be controlled via the SQS API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Long Polling vs Short Polling

A

Short polling returns a result immediately, even if the queue is empty. It also only checks a subset of servers, which could cause false empty responses.
Long polling does not return a response until there is a message in the queue. It also checks every server to avoid false empty responses.
Long polling should be used when possible, because it can reduce costs and false empty responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Using API

A

ChangeMessageVisibility – change a message’s visibility timeout.
SetQueueAttributes – change a queue visibility timeout.
ReceiveMessageWaitTimeSeconds – >0 enable long polling at the queue level.
SendMessage – send a message to a queue, can be used to set the message’s delay, as well as message attributes, and the message body.
delete a message;
GetQueueURL,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Advantage from using a queue

A

§ Components are loosely coupled for high availability, reliability, and
scalability
§ Protection against losing data on application failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is Amazon SQS different from Amazon MQ?

A

Amazon MQ – If you’re using messaging with existing applications, and want to move your messaging to the cloud quickly and easily; It supports industry-standard APIs and protocols so you can switch from any standards-based message broker to Amazon MQ without rewriting the messaging code in your applications.
SQS/SNS – If you are building brand new applications in the cloud, we recommend you consider Amazon SQS and Amazon SNS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How is Amazon SQS different from Amazon Kinesis Streams?

A

SQS– Decoupling the components of an application:
Configuring individual message delay:
Dynamically increasing concurrency or throughput at read time:
Scaling transparently: – Routing related records to the same record processor:
Allowing multiple applications to consume the same stream concurrently:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

SQS free Tier

A

The Amazon SQS Free Tier provides you with 1 million requests per month at no charge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can I track and manage the costs associated with my Amazon SQS queues?

A

You can tag and track your queues for resource and cost management using cost allocation tags. A tag is a metadata label comprised of a key-value pair. For example, you can tag your queues by cost center and then categorize and track your costs based on these cost centers.

17
Q

SQS use Case – video transcoding website uses EC2, SQS, S3, DynamoDB together.

A

End users submit videos to be transcoded to the website.
The videos are stored in Amazon S3, and a request message is placed in an incoming Amazon SQS queue with a pointer to the video and to the target video format within the message.
The transcoding engine that runs on a set of Amazon EC2 instances reads the request message from the incoming queue, retrieves the video from Amazon S3 using the pointer, and transcodes the video into the target format.
The converted video is put back into Amazon S3 and another response message is placed in another outgoing Amazon SQS queue with a pointer to the converted video.
At the same time, metadata about the video (format, date created, length, and so on) is indexed into Amazon DynamoDB for querying.

18
Q

Queue Requests

A

Basic Message Operations
SendMessage: Send messages to a specified queue.
ReceiveMessage: Return one or more messages from a specified queue.
DeleteMessage: Remove a previously received message from a specified queue.
ChangeMessageVisibility: Change the visibility timeout of a previously received message.
Batch Message Operations
SendMessageBatch: Send multiple messages to a specified queue.
DeleteMessageBatch: Remove multiple previously received messages from a specified queue.
ChangeMessageVisibilityBatch: Change the visibility timeout of multiple previously received messages.
Basic Queue Management
CreateQueue: Create queues for use with your AWS account.
ListQueues: List your existing queues.
DeleteQueue: Delete one of your queues.
PurgeQueue: Delete all the messages in a queue.
Advanced Queue Management
SetQueueAttributes: Control queue settings such as the visibility timeout (amount of time that messages are locked after being read so they cannot be read again), a delay value, or dead letter queue parameters.
GetQueueAttributes: Get information about a queue such as the visibility timeout, number of messages in the queue, or the maximum message size.
GetQueueUrl: Get the queue URL.
AddPermission: Add queue sharing for another AWS account for a specified queue.
RemovePermission: Remove an AWS account from queue sharing for a specified queue.
ListDeadLetterSourceQueues: List the queues attached to a dead letter queue.

19
Q

Does Amazon SQS support message metadata?

A

Yes. An Amazon SQS message can contain up to 10 metadata attributes.

20
Q

For anonymous access, what is the value of the SenderId attribute for a message?

A

When the AWS account ID is not available (for example, when an anonymous user sends a message), Amazon SQS provides the IP address.

21
Q

What is the AmazonSQSBufferedAsyncClient for Java?

A

Automatic batching of multiple SendMessage, DeleteMessage, or ChangeMessageVisibility requests without any required changes to the application
Prefetching of messages into a local buffer that allows your application to immediately process messages from Amazon SQS without waiting for the messages to be retrieved

22
Q

Can I delete all messages in a message queue without deleting the message queue itself?

A

Yes. You can delete all messages in an Amazon SQS message queue using the PurgeQueue action.

23
Q

Can I convert my existing standard queue to a FIFO queue?

A

No. You must choose the queue type when you create it. However, it is possible to move to a FIFO queue.

24
Q

Are Amazon SQS FIFO queues backwards-compatible?

A

To take advantage of FIFO queue functionality, you must use the latest AWS SDK.

25
Q

What happens if I issue a DeleteMessage request on a previously-deleted message?

A

When you issue a DeleteMessage request on a previously-deleted message, Amazon SQS returns a success response.

26
Q

What regions are queues with SSE available in?

A

SSE for Amazon SQS is available in the US East (N. Virginia and Ohio) and US West (Oregon) regions.

27
Q

What does SSE for Amazon SQS encrypt and how is it encrypted?

A

SSE encrypts the body of a message in an Amazon SQS queue.
SSE doesn’t encrypt the following components:
Queue metadata (queue name and attributes)
Message metadata (message ID, timestamp, and attributes)
Per-queue metrics

28
Q

What algorithm does SSE for Amazon SQS use to encrypt messages?

A

SSE uses the AES-GCM 256 algorithm.

29
Q

How large can Amazon SQS message queues be?

A

A single Amazon SQS message queue can contain an unlimited number of messages. However, there is a 120,000 limit for the number of inflight messages for a standard queue and 20,000 for a FIFO queue. Messages are inflight after they have been received from the queue by a consuming component, but have not yet been deleted from the queue.

30
Q

Can I share messages between queues in different regions?

A

No. Each Amazon SQS message queue is independent within each region.

31
Q

What is the pricing structure between various regions?

A

ou can transfer data between Amazon SQS and Amazon EC2 or AWS Lambda free of charge within a single region.
When you transfer data between Amazon SQS and Amazon EC2 or AWS Lambda in different regions, you will be charged the normal data transfer rate.