CPSC 4820 - DAY 13 MARCH 13, 2018 ================================================================================ Understanding the Properties of Distributed Queues -------------------------------------------------- Message Order At least once delivery message sample Amazon SQS Features ------------------- -Visibility timeout prevents multiple components from processing the same message. -When a message is received, it becomes "locked" while being processed. This prevents it from being processes by other computers. -The component that receives the message processes it and then deletes it from the queue. -If the message processing fails, the lock will expire and the message will be available again (fault tolerance). A dead letter queue is a list of messages that cannot be processed. It is used to sideline and isolate unsuccessfully processed messages. Amazon SQS Use Cases -------------------- -Work Queue -Buffering Batch operations -Request offloading -Fan-out -Auto Scaling Amazon Simple Notification Service (SNS) ---------------------------------------- Amazon SNS enables you to set up, operate and send notifications to subscribing services and other applications. Types: -Email -HTTP/HTTPS -Short Message Service (SMS) clients -Amazon SQS queues -Mobile push messaging -AWS Lambda function +--------------------------+----------------------------+---------------------+ | | Amazon SNS | Amazon SQS | +--------------------------+----------------------------+---------------------+ | Message persisitence | No | Yes | | Delivery Mechanism | Push (passive) | Poll (Active) | | Producer/consumer | Publish / subscribe | Send / receive | +--------------------------+----------------------------+---------------------+ Amazon API Gateway ------------------ Allows you to create APIs that act as front doors for your applications to access data, business logic, or functionality from your back-end services. Fully managed and handles all tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls Can handle workloads running on: -Amazon EC2 -Amazon Lambda -Any web app. Use AWS Lambda to Decouple your infrastructure -AWS Lambda is a good solution for processing data with high availability and limited cost footprint. -AWS Lambda allows you to further decouple your infrastructure by replacing traditional servers with simple microprocesses. How to use AWS Lambda --------------------- 1. Upload your code to AWS Lambda in .zip form. 2. Scheduled function / Event driven function 3. Specify its necessary compute resources. 4. Specify its timeout period 5. Specify the VPC whose resources it needs to access 6. Launch the function.