Messaging Flashcards
SQS
Simple Queuing Service
- used to decouple applications
- unlimited throughput and number of messages in the queue
- messages are persisted until consumers (applications) remove the message
SQS - Security
Encryption - can use in-flight HTTPS API, at-rest KMS keys or client-side encryption
Access Controls - IAM policies to regulate access to the SQS API
SQS Access Policies - S3 bucket policies
SQS – Message Visibility Timeout
After a message is polled by a consumer, it becomes invisible to other consumers, by default 30s
If a message is not processed within the visibility timeout, it will be processed twice unless the consumer asks for more time
SQS – Dead Letter Queue
Set a threshold of how many times a message can go back to the queue and if exceeded, send to dead letter queue
Retention of messages in DLQ is 14 days
SQS – Delay Queue
Delay visibility of a message to a consumer
SQS – FIFO Queue
First In First Out (ordering of messages in the queue)
SNS
A queue that follows a subscription model to send messages which allows for multiple consumers to consume the same message based on a topic
SNS - Security
Similar to SQS:
Encryption - can use in-flight HTTPS API, at-rest KMS keys or client-side encryption
Access Controls - IAM policies to regulate access to the SNS API
SNS Access Policies - S3 bucket policies
SNS + SQS: Fan Out
Pattern that push messages once into SNS, then is received in all SQS queues that are subscribers
AWS Kinesis
Kinesis is a managed alternative to Apache Kafka which is a application for big data i.e. logs, IoT, clickstreams
Kinesis Streams
Low latency streaming ingestion at scale to perform analytics
Kinesis Streams Shards
Streams are divided in ordered Shards / Partitions
- can scale over time
For a message, the same “partition” key goes to the same partition
Kinesis Data Firehose
Fully Managed Service, no administration, automatic scaling, serverless to load (big) data into Redshift / Amazon S3 / ElasticSearch / Splunk
Kinesis Data Analytics
Perform real-time analytics on Kinesis Streams using SQL
Ordering data into SQS
Use Group ID to scale consumers of SQS