AWS Integration & Messaging: SQS, SNS & Kinesis Flashcards
What are the two patterns of application communication?
Synchronous and asynchronous communication
What issue can arise with synchronous communication between applications?
It can be problematic if there are sudden spikes of traffic
What is a scenario that illustrates the need to handle sudden traffic spikes?
Encoding 1000 videos suddenly instead of the usual 10
What is a recommended approach to handle sudden increases in application demands?
Decouple your applications
What service can be used for a queue model in application decoupling?
SQS
What service can be used for a pub/sub model in application decoupling?
SNS
What service can be used for real-time streaming in application decoupling?
Kinesis
What is a benefit of using SQS, SNS, and Kinesis?
These services can scale independently from our application
Entities that send messages to the SQS queue.
Producers
You can have one or multiple producers sending a variety of messages, such as orders to process or videos to handle.
These can contain any information that the producer needs to communicate to the consumer.
Consumers
When a message is received, the consumer processes it and then removes it from the queue.
What is the purpose of SQS?
The primary role of SQS is to act as a buffer that decouples the producers of messages from the consumers.
What is the result of SQS?
By managing different loads and speeds between producers and consumers there is no lose of messages or overloading any component.
Features:
- Oldest offering (over 10 years old)
- Fully managed service, used to decouple applications
- Can have duplicate messages (at least once delivery, occasionally)
- Can have out of order messages (best effort ordering)
SQS – Standard Queue
Features:
- Unlimited throughput, unlimited number of messages in queue
- Default retention of messages: 4 days, maximum of 14 days
- Low latency (<10 ms on publish and receive)
- Limitation of 256KB per message sent
Attributes of *Standard Queue**:
How is a message produced?
Produced to SQS using the SDK (SendMessage API)
How long does a produced message persist.
persists in SQS until a consumer deletes it
How is a message consumed?
Consumers poll SQS for messages
Delete the messages using the DeleteMessage API
receive up to 10 messages at a time
Where do consumers run?
running on EC2 instances, servers, or AWS Lambda