AWS Integration & Messaging Flashcards

1
Q

There are two patterns of application communication

A

1) Synchronous communications (application to application)

2) Asynchronous / Event based (application to queue to application)

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

name all three different models for decoupling your application

A
  • using SQS: queue model
  • using SNS: pub/sub model
  • using Kinesis: real-time streaming model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SQS - How many messages can be in the queue?

A

Unlimited

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

SQS - What’s the size lmitation per message sent?

A

256kb

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

What’s SQS – Delay Queue

A

• Delay a message (consumers don’t see it immediately) up to 15 minutes • Default is 0 seconds (message is available right away)

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

What parameter overrides the default SQS – Delay Queue?

A

DelaySeconds parameter

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

What can you expect to get back from SQS

A
  • Message identifier

* MD5 hash of the body

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

What’s the lifecycle of SQS - Consuming Messages?

A
  • Poll SQS for messages (receive up to 10 messages at a time) • Process the message within the visibility timeout
  • Delete the message using the message ID & receipt handle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is SQS - Visibility timeout?

A

When a consumer polls a message from a queue, the message is “invisible” to other
consumers for a defined period… the Visibility Timeout:

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

What is the limits and default for SQS - Visibility timeout?

A

• Set between 0 seconds and 12 hours (default 30 seconds)

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

SQS - What’s the API to change the visibility while processing a message?

A

ChangeMessageVisibility

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

What’s the API to tell SQS the message was successfully processed?

A

DeleteMessage

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

What is a Dead Letter Queue?

A

-If a consumer fails to process a message within the Visibility Timeout…
the message goes back to the queue!
• We can set a threshold of how many times a message can go back to the queue – it’s called a “redrive policy”
• After the threshold is exceeded, the message goes into a dead letter queue (DLQ)
• We have to create a DLQ first and then designate it dead letter queue
-Make sure to process the messages in the Failure DLQ before they expire!

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

Define AWS SQS - Long Polling.

A

-When a consumer requests message from the queue, it can optionally “wait” for messages to arrive if there are none in the queue
• This is called Long Polling
• LongPolling decreases the number of API calls made to SQS while increasing the efficiency and latency of your application.
-The wait time can be between 1 sec to 20 sec (20 sec preferable)

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

SQS Long polling can be enabled at the queue level or at the API level using what param?

A

WaitTimeSeconds

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

SQS - FIFO has higher or lower throughput?

A

Lower throughput (up to 3,000 per second with batching, 300/s without)

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

SQS - FIFO Message groups allow for what?

A

Possibility to group messages for FIFO ordering using “Message GroupID”

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

SNS - Up to ___ subs per topic

A

Up to 10,000,000 subscriptions per topic

19
Q

SNS - What’s the topics limit?

A

100,000 topics limit

20
Q

SNS - Who can subscribe?

A
  • SQS
  • HTTP / HTTPS (with delivery retries – how many times)
  • Lambda
  • Emails
  • SMS messages
  • Mobile Notifications
21
Q

SNS - How do you publish a topic (within your AWS Server – using the SDK)?

A
  • Create a topic
  • Create a subscription (or many)
  • Publish to the topic
22
Q

Explain AWS Kinesis

A
  • Kinesis is a managed alternative to Apache Kafka
  • Great for application logs, metrics, IoT, clickstreams
  • Great for “real-time” big data
  • Great for streaming processing frameworks (Spark, NiFi, etc…)
23
Q

Kineses Data is automatically replicated to how many AZ’s?

A

Data is automatically replicated to 3 AZ

24
Q

What are the three types of Kinesis?

A
  • Kinesis Streams: low latency streaming ingest at scale
  • Kinesis Analytics: perform real-time analytics on streams using SQL
  • Kinesis Firehose: load streams into S3, Redshift, ElasticSearch…
25
Q

Kinesis Streams are ordered into?

A

Shards / Partitions

26
Q

Kinesis Streams Data retention is what by default and can go up to how many days?

A

Data retention is 1 day by default, can go up to 7 days

27
Q

Kinesis Streams give you the ability to reprocess / replay data?

A

True

28
Q

Kineses Streams - Only a single app can consume a single stream. T / F?

A

False - Multiple applications can consume the same stream

29
Q

Kineses Streams - Once data is inserted in Kinesis, it can’t be deleted (immutability) T/F

A

True

30
Q

Kineses Streams Shards - What size or how many messages per second?

A

1MB/s or 1000 messages/s at write PER SHARD

31
Q

Kineses Streams - How many MB per read?

A

2MB/s at read PER SHARD

32
Q

Kinese Streams Billing?

A

Billing is per shard provisioned, can have as many shards as you want

33
Q

Kinesis Streams shard records are ___ per shard?

A

Ordered

34
Q

How to reduce costs and increase throughput of kineses streams?

A

Use Batching with PutRecords

35
Q

AWS Kinesis API - ProvisionedThroughputExceeded Exceptions. Explain this

A

Happens when sending more data (exceeding MB/s or TPS for any shard)
• Make sure you don’t have a hot shard (such as your partition key is bad and too much data goes to that partition)

Solution
• Retries with backoff
• Increase shards (scaling)
• Ensure your partition key is a good one

36
Q

AWS Kinesis API – Consumers have two options in terms of use.. Normal consumer (CLI, SDK..) and…

A
  • Can use a normal consumer (CLI, SDK, etc…)
    • Can use Kinesis Client Library (in Java, Node, Python, Ruby, .Net)
    • KCL uses DynamoDB to checkpoint offsets
    • KCL uses DynamoDB to track other workers and share the work amongst shards
37
Q

Kineses Security - Control access / authorization using..

A

IAM policies

38
Q

Kineses Security - Encryption in flight using…

A

HTTPS endpoints

39
Q

Kineses Security - Encryption at rest using…

A

KMS

40
Q

Is the possibility to encrypt / decrypt data client side there?

A

Yes but it’s harder

41
Q

What support is there for VPC access?

A

VPC Endpoints available for Kinesis to access within VPC

42
Q

Explain AWS Kinesis Data Analytics

A

Perform real-time analytics on Kinesis Streams using SQL
• Kinesis Data Analytics: • Auto Scaling
• Managed: no servers to provision • Continuous: real time
• Pay for actual consumption rate
• Can create streams out of the real-time queries

43
Q

Explain AWS Kinesis Firehose

A
  • Fully Managed Service, no administration
  • Near Real Time (60 seconds latency)
  • Load data into Redshift / Amazon S3 / ElasticSearch / Splunk • Automatic scaling
  • Support many data format (pay for conversion)
  • Pay for the amount of data going through Firehose
44
Q

What is Amazon MQ

A

managed Apache ActiveMQ. When migrating to the cloud, instead of re-engineering the application to use SQS and SNS, we can use Amazon MQ

  • Amazon MQ doesn’t “scale” as much as SQS / SNS
  • Amazon MQ runs on a dedicated machine, can run in HA with failover
  • Amazon MQ has both queue feature (~SQS) and topic features (~SNS)