Decoupling Workflows Flashcards
What is meant by tight coupling?
One application (or instance) talking directly to another application (or instance).
What is meant by loose coupling?
Not having one application (or instance) talk directly to another. Instead you want highly available, scalable, managed service in between resources (like ELB)
What is Simple Queue Service (SQS)?
SQS is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems and serverless applications
What is Simple Notification Service (SNS)?
SNS is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication
What is API Gateway?
API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor and secure APIs at any scale
Which is preferred: tight or loose coupling?
Loose coupling is ALWAYS preferred. Don’t select answers that include instance-to-instance communication.
Where is important for applications to be loosely coupled?
Every layer, both internal and external
What is poll-based messaging?
A producer of messages writes a message into a queue (SQS) and a consumer can retrieve the message whenever it is ready
What is Simple Queue Service (SQS)?
Simple Queue Service is a messaging queue that allows asynchronous processing of work. One resource will write a message to an SQS queue, and then another resource will retrieve that message from SQS.
What is the delivery delay in SQS?
The queue hides messages for this period of time before making them visible. Default is 0 and maximum is 15 minutes.
What is the message size in SQS?
Messages can be up to 256KB in any format
What encryption is provided by default in SQS?
Messages are encrypting in-transit by default, but you can add at-rest
What is message retention setting in SQS?
The length of time that a message can be kept in SQSl. Default is 4 days; can be set between 1 minute and 14 days.
What is the difference between long and short polling in SQS?
Short polling checks for messages and exits if none exists, which burns extra CPU cycles. Long polling isn’t the default in SQS, but it should be (setting the connection time window).
What is the queue depth in SQS?
This is a value, not a setting. This can be a trigger for autoscaling.
What is the visibility timeout in SQS?
A lock on a message (default 30 seconds) where no other consumer can receive the message while a consumer is processing it and reaches out to say it is done.
If the message is successfully processed within the visibility timeout, the message is deleted from the queue.
If you are asked a question about what to look for if you are burning too much CPU (cash) with an SQS queue, what setting would you recommend looking at?
The connection time window (set it for long polling)
What is a dead letter queue in SQS?
An SQS queue that you can temporarily sideline messages into when they can’t be processed successfully from the main queue.
What is the dead letter queue setting, maximum receives, used for?
The maximum number of times the message can be read before it gets sidelined to the dead letter queue
What is an important metric to monitor on a dead letter queue in SQS?
Queue depth
Can you use dead letter queues with SNS?
Yes, on SNS topics
What type of message ordering is guaranteed with Standard SQS queues?
Best effort ordering
Is there a guarantee around not receiving duplicate messages with Standard SQS queue?
No
What type of SQS queue guarantees messages are delivered in order?
FIFO queue (and also guarantees no duplicates)
What is the guaranteed number of transactions per second processing in a Standard SQS queue vs a FIFO SQS queue?
Standard queue has nearly unlimited transactions per second where the FIFO queue guarantees 300 messages per second
What is the message deduplication Id in FIFO SQS queues?
A unique value that ensures that all of your messages are unique. The deduplication interval is a five minute window, where if we see the same deduplication id multiple times, it will receive the message successfully but will not pass it along to the consumer
If you are given a scenario where it is important that messages are processed in order, or they not be duplicates, what type of SQS queue would you recommend?
FIFO
If you are given a scenario where you must have thousands and thousands of transactions per second processing in an SQS queue, what type of queue would you recommend?
Standard (FIFO maxes out at 300 messages per second)
What is the message group id used for in FIFO queues in SQS?
It is the identifier that ensures that all messages with that same id are received and processed in order.
Which costs more, standard for FIFO queues in SQS?
FIFO
What is push-based messaging?
A producer of messages writes a message into a topic (SNS) and the topic delivers it to its subscribers whenever it is ready; the subscribers must be ready and waiting to receive the message
What services can subscribe to an SNS topic?
Kinesis Data Firehose, SQS, Lambda, email, HTTP(S), SMS (text), platform application endpoint
What is the maximum message size allowed in SNS?
256KB of text in any format
Does SNS support a Dead Letter Queue?
Yes, messages that fail to be delivered can be stored in an SQS DLQ