AWS SQS Flashcards

1
Q

What is SQS?

A

It is a managed message queue.

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

What is SQS used for?

A
  • Distributed and decoupling applications

- Buffering incoming load, so slower services like a database can deal with the write load more evenly.

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

What is the max size of a message?

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

How can we store large amounts of data?

A
  • Store the data in S3 and reference it in the SQS message.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What options have I for receiving messages from SQL, can I have SQL push messages to me?

A

No, there is no push methods available form SQL, you have to use long or short poll methods to get a message from SQS.

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

What is the difference between long and short poll?

A
  • Long poll means when you make a call to SQL the call will not return until the number of messages specified in the call are available or the time out occurs.
  • Short pool means it will return if there is no messages available
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What types of SQS queues are available?

A
  • Standard queue

- FIFO queue

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

What is the difference between FIFO and standard queues?

A

Standard queues have infinite capacity, messages are not guaranteed to be delivered just once, messages are not guaranteed to be delivered in order.
- FIFO queues have a limited capacity, guarantee message order and only one comply of the message will be delivered.

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

What is the capacity of FIFO queue?

A

300 messages per sec for single messages and 3K mps for batched messages.

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

I have an SNS topic, is it possible to have messages delivered to an SQL queue?

A

Yes, SNS supports SQS as an endpoint.

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

Explain what the visibility time out is?

A

The visibility time out is the amount of time a message stays invisible after it is received by a consumer if the consumer does not delete the message from the SQS queue before the visibility time out expires the message will become visible on the SQS queue and another consumer can consume it.

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

How long can I have a long poll for?

A

1 - 20 seconds

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

Are messages retained for a period and what is the period?

A

Default is 4 days and max is 14 days

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

I would like to move away from using EC2 instances for processing SQS messages, what options do I have?

A

You can now use Lambda, in the model Lambda is automatically invoked to process the message in the SQS queue, this is no need to poll.

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

I have a solution thet has EC2 instances thet process messages, I wnat to make this solution more dynamic and have the number of EC2 instances be elastic and grow and shrink based on the number of messages in the SQS queue, how can this solution be modified?

A

Create an autoscaling group and set it scaling policy to use cloud watch alarms, we also set up cloudwatch alarms to trigger on the number of messages in the SQS queue.

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

I have a VPC and I wnat to access the SQS privately without going over the internet as my VPC is a private VPC, how cna I achieve this?

A

Use a VPC endpoint, this will pace an interface in the VPC and you can access the SQS via the endpoint.

17
Q

I wnat to delay a message form the time it is received until it is visible on the SQS queue?

A

You can use the delivery delay.

18
Q

I some times have EC2 instances they are unable to process messages, I would like to have these messages automatically handled by a lambda function I have created, how can I architect this?

A

You will need to,

  • Set up a dead letter queue to received the unprocessed messages
  • Register the lambda function on this dead letter queue to process the dead letter messages.
19
Q

What is a deal letter queue?

A

Unprocessed messages are sent to this queue to be handled.

20
Q

My orgnization has a policy that means all data at rest is to be encrypted, I am using SQS, what options do I have?

A

You cna have SQS use server-side encryption to transparently encrypt and decrypt messages.

21
Q

What I create an SQS queue, how do I interact with the queue?

A

Each SQS queue will get a URL at the time of creation.

22
Q

I wnat to have better visibility into my SQS queue, what options do I have?

A

You cna use cloud watch metrics to see,
- NumOfMessagesSent
- NumOfMessagesReceived
etc

23
Q

I wnat to have multiple consumers consuming the same messages from an SQS queue, how can I architect this?

A

You cna not do this with SQS, this is a kinesis type ability.

24
Q

What is the default, min and max visibility time outs?

A

default is 30 sec, min is 0 and max is 12hrs.

25
Q

I am using a standard queue, is order preserved?

A

No

26
Q

I am using a FIFO queue, is order preserved?

A

Yes

27
Q

I am using a FiFO queue, am I guaranteed to only received a message once?

A

Yes

28
Q

I am using a standard queue, am I guaranteed to only received a message once?

A

No, you can receive the message multiple times, you have to deal with this in code.

29
Q

My orgnization has a policy of ensuring all traffic is encrypted in transit and at rest, what do I have to do in SQS to meet this requirement?

A
  • Enable encryption at rest

- HTTPS is used for all traffic in transit so this is already meeting the in-transit requirement.

30
Q

I am using a FIFO queue, how can I deliver the max number of messages to the SQS queue?

A

Use the batch API/CLI command when sending messages

31
Q

How are messages globally identified?

A

As SQS receives a message it gives each message a global ID.

32
Q

How can I add small amounts of extra metadata to a message?

A

Metadata (key/value) can be added to to a message

33
Q

I have two producers of messages sending messages to a SQS queue, how can I group these messages and ensure order for the consumers?

A

You can use the group ID to group the me3ssages and preserve the order.

34
Q

Is SQS PCI and HIPPA certified?

A

Yes