03 - Application Integration Flashcards
Simple Queue Service (SQS)
1) Messaging queue for decoupling distributed software systems and components
2) Supports both standard and FIFO queues
3) Supports Long Polling
4) Delay queues allow you to delay the delivery of a new messages for a defined period of seconds
5) Visibility timeout is a period of time SQS prevents other consumers from receiving and processing messages
6) Uses a pull based polling method
7) Can be accessed via VPC endpoints, without the need of public IPs and without having to travel the internet
Simple Queue Service (SQS) Types of Queues
1) Standard Queues
* Unlimited Throughput
* At-least-once Delivery
* Best-Effort Ordering
* Use when throughput is important
2) FIFO Queues
* High Throughput (3,000 msgs/s)
* Exactly-Once Processing
* First-in First-Out Delivery
* Use when order of events is
Simple Queue Service (SQS) Part 2
1) Dead-Letter Queues
* A queue that us used to store messages that cannot be processed for some reason
* Great for debugging applications and systems
* DLQs must be created as a standard of FIFO queue, then configure as a DLQ
* Uses a re-drive policy which identifies the source queue, the dead letter queue, and any conditions that need to occur to redirect messages to the DLQ
2) When to use DLQs
* With standard queues, Application doesn’t depend on ordering
* Decrease number of messages, Poison-pill messages (Received but not processed)
Simple Notification Service (SNS)
1) Used to send notifications from the AWS Cloud
2) Follows the “pub-sub” (publish-subscribe) model
3) Messages delivered to clients using a push in an event-driven matter
4) Message filtering can be used to only get notifications that are needed
5) Message fanout is when a message is sent to a SNS topic then replicated and pushed to multiple endpoints for parallel processing
6) 4-phase retry policy
* Retries with no delay in between attempts
* Retries with some minimum delay between attempts
* Retries with some back-off model (linear or exponential)
* Retries with some maximum delay between attempts
AppSync
EventBridge
AWS Step Functions
1) Serverless managed orchestration for applications
2) Use visual workflows to coordinate the components of distributed applications and microservices
3) Based on the concepts of tasks and state machines
* A task performs work by using an activity or a Lambda function or by passing parameters via an API call
* A state machine can express an algorithm as a number of states, their relationships, and inputs/outputs
Amazon Simple Queue Service (Amazon SQS) Cheat Sheet
1) SQS is a queuing service using messages with a queue. Think Sidekiq or RabbitMQ
2) SQS is used for Application Integration, it lets decoupled services and apps to talk to each other
3) To read SQS user need to pull the queue using the AWS SDK. SQS is not pushed-based
4) SQS supports both standard and First-In-First-Out (FIFO) queues
5) Standard allows nearly unlimited messages per second, does not guarantee order of delivery, always delivers at least once, you must protect again duplicate messages being processed
6) FIFO maintain the order of messages with a 300 limit
7) There are 2 kinds of polling: Short (Default) and Long Polling
8) Short polling returns messages immediately, even if the message queue being polled is empty
9) Long polling waits until message arrives in the queue, or the long poll timeout expires
10) In majority of cases Long polling is preferred over short polling
11) Visibility time-out is the period of time that messages are invisible in the SQS queue
12) Messages will be deleted from queue after a job has processed (before visibility timeout expires)
13) If Visibility timeout expires than a job will become visible to the queue
14) The default Visibility time-out is 30 seconds. Timeout can be 0 seconds to a maximum of 12 hours
15) SQS can retain messages from 60 seconds to 14 days and by default is 4 days
16) Message size between 1 byte to 256 kb, Extended Client Library for Java can increase to 2 GB
Amazon Simple Notification Service (Amazon SNS) Cheat Sheet
1) SNS is a fully managed pub/sub messaging service
2) SNS is for Application Integration. It allows decoupled services and apps to communicate with each other
3) Topic is a logical access point and communication channel
4) A topic is able to deliver to multiple protocols
5) You can encrypt topics via KMS
6) Publishers use the AWS API via AWS CLI or SDK to push messages to a topic. Many AWS services integrate with SNS and act as publishers
7) Subscriptions subscribe to topics. When a topic receives a message it automatically and immediately pushes messages to subscribers
8) All messages publishes to SNS are stored redundantly across multiple Availability Zones (AZ)
9) The following protocols:
* HTTP and HTTPs - Create web-hooks into your web-application
* Email - Good for internal email notifications (only supports plain text)
* Email-JSON - Send you json via email
* Amazon SQS - Place SNS message into SQS queue
* AWS Lambda - Triggers a lambda function
* SMS - Send a text message
* Platform application endpoints - Mobile Push eg. Apple, Google, Microsoft, Baidu notifications systems