Chpater 11 Refactor to Microservices Flashcards
Explain AWS SQS at a high level
Simple Queue Service. It temporarily stores messages from a provider while it waits for a message producer to process the message.
Messages are stored passively (no notification)
What are the limits to the number of producers and consumers for SQS?
There are no limits. SQS is a distributed cluster of servers.
List states of SQS message
- Sent to queue by a producer
- Received from queue from a consumer
- Deleted from queue
What is an ‘in-flight’ state for an SQS message?
When a message is b/t states of received and deleted. There are a finite number of in-flight messages that can be processed.
What is ‘Long-Polling’ in SQS and how do you implement it?
Method to reduce operational cost of SQS by eliminating empty responses.
Achieved by setting longer time intervals for the ‘ReceiveMessage’ action (max is 20 seconds, min is 1 second)
What is the ‘VisibilityTimeout’?
SQS actions which is the duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ‘ReceiveMessage’ request.
If you find yourself setting the VisibilityTimeout action in SQS to longer than 12 hours, what should you consider doing instead?
Use AWS Step Functions
What is a ‘Dead Letter Queue’?
A queue/dump where failed messages are stored. For example, a user order item with a deleted product ID. Associated message can be sent to the dead letter queue.
Useful for:
- configuring alarm for any messages received in DLQ
- analyze contents of problematic messages
- determineif you gave consumer sufficient processing time
- DLQ must be FIFO when used w/ SQS FIFO queue
- DLQ must be standard when used w/ SQS Standard Queue
SQS Standard Queues ensure scalability and throughput by having what two tradeoffs?
- order is not guaranteed
- messages can appear twice
What is alternative to SQS Standard Queues?
SQS FIFO queues:
- provide ordered messages
- delete any duplicates that appear in queue
With Kinesis Data Streams, how/when are messages/records deleted?
Via a retention interval expiration, which you configure
How to support high throughput in Kinesis Data Streams?
Increase number of shards in Kinesis Data Stream system
Difference b/t Kinesis Firehose and Kinesis Data Streams?
Higher level. Firehose does not require you to write a consumer application.
Also Firehose handles dynamic scaling of underlying shards and automatically delivers data to services like S3, Redshift, etc.
AWS Kinesis Data Analytics
Allows you to process and analyze streaming data with SQL. Good for performing time series analytics, feed real time dashboards, create real time metrics.
For Kinesis Streams, what is data made of?
- ‘data blobs’ of up to 1MB attached to a…
- ‘record key’ (metadata to tell which shard to go to)
- sequence #