AWS 18 Flashcards

1
Q

What can be problematic with synchronous messaging between applications?

A

Sudden spikes in traffic can cause issues

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

What is the default time a message can be in a queue? What is the max?

A

4 days, 14 days

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

What is the max size for messages sent to SQS?

A

256 kb

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

How can we scale applications processing SQS messages?

A

We could possibly put the applications processing the SQS on EC2 instances with an ASG;
The ASG will go off of the CloudWatch metric ApproximateNumberOfMessages and set an alarm. The alarm will trigger and ASG will scale.

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

To finish the process of an SQS message, what must we do?

A

Delete it

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

What is Message Visibility Timeout in SQS?

A

This means that when a message is polled by a consumer it becomes “invisible” to other consumers. Default time is 30 seconds;
Must be processed in 30 seconds or returned to queue

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

If a consumer needs more time than the default Message Visibility Timeout, what can they do?

A

Call the ChangeMessageVisibility API to get more time

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

What is Long Polling? Why would we use it?

A

A consumer can optionally “wait” for messages to arrive if there are none in the queue;
LongPolling decreases the number of API calls made to SQS while increasing the efficiency and latency of your application;

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

What is the SQS Extended Client?

A

Uses an Amazon s3 bucket as a medium between the producer and consumer. Consumer will consume the message in S3. This helps with large amounts of data.

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

What is the SQS Long Polling API call?

A

RecieveMessageWaitTimeSeconds

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

What is the difference between FIFO queue and standard queue?

A

FIFO queue makes sure that first messages in are first messages out. Standard queue does not guarantee order

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

What must be done to the name of the queue if it’s FIFO?

A

Must have extension .fifo

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

What are the two deduplication methods for SQS FIFO?

A

Content based deduplication: will do a SHA-256 hash of the message body to make sure same bodies aren’t sent twice
Explicitly provide a Message Duplication ID

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

What are the two deduplication methods for SQS FIFO?

A

Content based deduplication: will do a SHA-256 hash of the message body
Explicitly provide a Message Duplication ID

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

How would you use the MessageGroupID in SQS FIFO?

A

you can specify a MessageGroupID so that only one consumer can take that group of messages.

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

What are the protocols for endpoints in subscribing to SNS?

A

HTTP/S;
Email (JSON);
Amazon SQS;
AWS Lambda

17
Q

What is the SNS + SQS Fan Out method?

A

A notification is pushed to SNS, where it will be received by all SQS queues. Allows for data persistence, delayed processing and retries of work

18
Q

SNS can send messages to Amazon FIFO queues, true or false?

A

False

19
Q

We want to create notifications that an object has been created in S3 and we need it to go to multiple services, how do we architect this?

A

For the combination of event type and prefix in S3, we can only have one S3 event rule. We can send that event notification to an SNS topic and that then published to multiple queues for processing

20
Q

What is Kinesis?

A

Kinesis provides real time data capabilities from devices to outputs such as Redshift, DynamoDB and S3 bucket.

21
Q

How long does a Kinesis shard keep data?

A

1 day, up to 7

22
Q

How do we send data to the Kinesis API?

A

PutRecord API + Partition key that gets hashed (same key goes to same partition)

23
Q

How do we prevent “hot partitions” in AWS Kinesis?

A

We choose a partition that is highly distributed;
For example, if we have a lot of users, UserID is a good choice but not country_id if the users are mainly in one country

24
Q

What is the Kinesis Client Library?

A

It is a Java library that helps read record from a Kinesis Streams with distributed applications sharing the read workload.

25
Q

Each shard is to be read by only one KCL instance, true or false?

A

True

26
Q

How do the KCL’s in Kensis keep track of the workload?

A

They check their progress into DynamoDB

27
Q

Kinesis records are read in order at the stream level, true or false?

A

False. They are read in order from the shard level

28
Q

What is Kinesis Data Analytics?

A

Perform real time analytics using SQL

29
Q

What is Kinesis Firehose?

A

It is used to load data into Redshift / S3 / ElasticSearch / Splunk

30
Q

We want to scale our SQS FIFO. How can we do this?

A

Use Group ID and scale the consumers to take care of each group

31
Q

You are preparing for the biggest day of sale of the year, where your traffic will increase by 100x. You have already setup SQS standard queue. What should you do?

A

Do nothing, SQS scales automatically

32
Q

You would like messages to be processed by SQS consumers only after 5 minutes. What should you do?

A

Increase the delay queue (DelaySeconds API)

33
Q

Your consumers poll 10 messages at a time and finish processing them in 1 minute. You notice that your messages are processed twice, as other consumers also receive the messages. What should you do?

A

Increase VisibilityTimeout

34
Q

Your SQS costs are extremely high. Upon closer look, you notice that your consumers are polling SQS too often and getting empty data as a result. What should you do?

A

Enable long polling

35
Q

You are sending a clickstream for your users navigating your website, all the way to Kinesis. It seems that the users data is not ordered in Kinesis, and the data for one individual user is spread across many shards. How to fix that problem?

A

You should use a partition key that represents the identity of the user