Section 17: Decoupling Applications: SNS, SQS, Kinesis, Active MQ Flashcards
What does “decoupling” mean in “decoupling applications”?
Decoupling refers to app components remaining autonomous and unaware of each other as they do their work
;What are the two patterns of application communication?
1) Synchronous communication (app to app)
2) Asynchronous / Event based communication (application to queue to application)
When can Synchronous communication become problematic and what is the solution?
Synchronous communication can become problematic if there are sudden spikes in traffic. The solution is to decouple your application
What is SQS Queue?
SQS is a distributed message queue that can reliably queue messages, with one component consuming messages that are produced by another
In terms of SQS Queue, what is a producer?
A producer is what sends messages to the queue (like an API)
In terms of SQS Queue, what is a consumer?
A consumer is what receives messages from the queue, reading and deleting them
What types of issues does a queue resolve, and how does it do so?
By acting as a buffer between applications, the queue resolves issues such as:
1) Producer is producing work faster than consumer can handle
2) Issues arising from intermittent network connectivity of either the producer, consumer, or both
What is SQS queueing used for?
SQS queueing is used for decoupling application components so they can run independantly.
Are SQS queues push or pull based?
SQS Queues are pull based, not pushed base. This means someone or something needs to be consuming the messages.
How long do SQS messages persist?
A Consumer message persists in SQS until a consumer deletes it
What are some common SQS consumers?
EC2 instances & Lambda functions are common SQS consumers
How can you save on SQS consumer costs?
Use the DeleteMessage API to delete messages after processing them.
How do consumers receive messages from SQS?
Consumers have to poll the SQS queue, and can only receive up to 10 messages at a time.
What is a very common application architecture using SQS, and why is it beneficial?
An extremely common architecture is to use SQS to decouple a backend and frontend. This improves reliability and performance by allowing us to scale the backend and frontend independently.
What is a very common application architecture using SQS, and why is it beneficial?
An extremely common architecture is to use SQS to decouple a backend and frontend. This improves reliability and performance by allowing us to scale the backend and frontend independently.
What are the two SQS queue types?
1) SQS Standard Queues (default)
2) SQS FIFO (First in First Out) Queues