SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
SQS
& Loose Coupling
By
Sandip Chaudhari
Director, Beacon Edutech
http://beaconedutech.com
About Myself
•  13+ years of professional experience in Software Industry
•  Former CTO @ Krossover
•  Director @ Beacon Edutech
•  Panel Speaker in New York @ NYTech on Benefits of Cloud
for Video and Image:
https://www.nytech.org/events/cloud-video-image
•  Blog: http://hashbulb.com
•  Twitter: @sandipchaudhari
•  Email: sandipchaudhari@gmail.com
Queue?
Fun Water Queue
What is SQS?
•  Amazon Simple Queue Service is a fast, reliable,
scalable and fully managed queue service

•  Amazon SQS enables asynchronous message-based
communication between distributed components of
an application
SQS – What it can do?
•  Amazon AWS SQS page:
•  SQS makes it simple and cost-effective to decouple the
components of a cloud application
•  You can use SQS to transmit any volume of data, at
any level of throughput, without losing messages or
requiring other services to be always available
•  With SQS, you can offload the administrative burden of
operating and scaling a highly available messaging
cluster, while paying a low price for only what you use.
SQS – Major Features
•  Redundant Infrastructure
•  Multiple writers and readers
•  Configurable settings per queue
•  Variable message size (up to 256 KB)
•  Access Control
•  Delay Queues
SQS – Message Visibility Timeout
SQS – Message Visibility Timeout
• 

The visibility timeout clock starts ticking once Amazon SQS returns the
message

• 

During that time, the component processes and deletes the message

• 

But what happens if the component fails before deleting the message?

• 

If your system doesn't call DeleteMessage for that message before the
visibility timeout expires, the message again becomes visible to the
ReceiveMessage calls placed by the components in your system and it will
be received again

• 

If a message should only be received once, your system should delete it
within the duration of the visibility timeout

• 

Each queue starts with a default setting of 30 seconds for the visibility
timeout
SQS Message Lifecycle
SQS Message Lifecycle
•  Messages that are stored in Amazon SQS have a lifecycle that is
easy to manage but ensures that all messages are processed.
1. 
2. 
3. 

4. 

A system that needs to send a message will find an Amazon SQS
queue, and use SendMessage to add a new message to it
A different system that processes messages needs more messages to
process, so it calls ReceiveMessage, and this message is returned
Once a message has been returned by ReceiveMessage, it will not be
returned by any other ReceiveMessage until the visibility timeout has
passed. This keeps multiple computers from processing the same
message at once.
If the system that processes messages successfully finishes working
with this message, it calls DeleteMessage, which removes the message
from the queue so no one else will ever process it. If this system fails to
process the message, then it will be read by another ReceiveMessage call
as soon as the visibility timeout passes
SQS – Long Polling
•  Benefit of long polling with Amazon SQS is the
reduction of the number of empty responses, when there
are no messages available to return, in reply to a
ReceiveMessage request sent to an Amazon SQS queue
•  Long polling allows the Amazon SQS service to wait
until a message is available in the queue before sending a
response
•  So unless the connection times out, the response to the
ReceiveMessage request will contain at least one of the
available messages (if any) and up to the maximum
number requested in the ReceiveMessage call
SQS – Delay Queues
SQS – Delay Queues
•  Delay queues allow you to postpone the delivery of new
messages in a queue for a specific number of seconds
•  If you create a delay queue, any message that you send to
that queue will be invisible to consumers for the duration
of the delay period
•  You can use CreateQueue to create a delay queue by
setting the DelaySeconds attribute to any value between 0
and 900 (15 minutes)
•  You can also turn an existing queue into a delay queue by
using SetQueueAttributes to set the queue's DelaySeconds
attribute
SQS Pricing
Components
Loose – Tight Coupling
Loose – Tight Coupling
Loose Coupling
•  What if the whole
leg was a single
bone?
•  Stiff and rigid?
•  Or the joins in the
leg bones were
NOT looselycoupled?
Thinking…
Components and Loose Coupling
SQS and Loose Coupling
SQS – Common Design Patterns
•  Work Queues: Decouple components of a distributed
application that may not all process the same amount of work
simultaneously
•  Buffer and Batch Operations: Add scalability and reliability to
your architecture, and smooth out temporary volume spikes
without losing messages or increasing latency
•  Request Offloading: Move slow operations off of interactive
request paths by enqueing the request
•  Fanout: Combine SQS with Simple Notification Service (SNS)
to send identical copies of a message to multiple queues in
parallel for simultaneous processing
Scalability – Cloud Scalability
Concurrency and Load Sharing
•  Simultaneous access to SQS complements
concurrency

•  Concurrent writes and reads promote load sharing

•  Sharing load across machines / nodes opens the
door to scalability
Sync versus Async
•  SQS offers completely asynchronous communication
•  Source component can literally send and forget. It
can immediately proceed to further processing
without delay or wait for response
•  Visibility timeout assures managed concurrency
•  Visibility timeout ensures fail safety - each message
is processed, even on failures. As long as the
message is processed before retention expiry (14
days)
Typical Use Cases
•  Photo Processing - Instagram
•  Number crunching and analytics for reporting
•  Offline reports generation
•  Video encoding - Krossover
•  Email and SMS bulk messaging
Case Study
– Krossover Video Processing
•  Burst loads – large simultaneous, concurrent uploads
•  Video codec encoding is heavy processing
•  Large and heavy video processing load demands load sharing
•  Group of video encoding machines (upto 50) concurrently
access the uploaded video-load queue
•  Once video-load-message is read, the individual machine
encodes the video before the message visibility timeout (set to 8
hours)
•  Multiple such simultaneous encoding processes run on each
machine (upto 8)
Questions ?

Más contenido relacionado

La actualidad más candente

AWS SQS for better architecture
AWS SQS for better architectureAWS SQS for better architecture
AWS SQS for better architectureSaurabh Bangad
 
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...Amazon Web Services
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon Web Services Korea
 
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon Web Services Korea
 
Azure role based access control (rbac)
Azure role based access control (rbac)Azure role based access control (rbac)
Azure role based access control (rbac)Srikanth Kappagantula
 
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인Amazon Web Services Korea
 
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017Amazon Web Services Korea
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정Arawn Park
 
[AWS Builders 온라인 시리즈] AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트
[AWS Builders 온라인 시리즈]  AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트[AWS Builders 온라인 시리즈]  AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트
[AWS Builders 온라인 시리즈] AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 Amazon Web Services Korea
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20Amazon Web Services Korea
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017Amazon Web Services Korea
 
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016Amazon Web Services Korea
 
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWSKRUG - AWS한국사용자모임
 
Amazon Athena Capabilities and Use Cases Overview
Amazon Athena Capabilities and Use Cases Overview Amazon Athena Capabilities and Use Cases Overview
Amazon Athena Capabilities and Use Cases Overview Amazon Web Services
 
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)Amazon Web Services Korea
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우if kakao
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayAmazon Web Services Korea
 

La actualidad más candente (20)

AWS SQS for better architecture
AWS SQS for better architectureAWS SQS for better architecture
AWS SQS for better architecture
 
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
 
Azure role based access control (rbac)
Azure role based access control (rbac)Azure role based access control (rbac)
Azure role based access control (rbac)
 
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인
Aurora MySQL Backtrack을 이용한 빠른 복구 방법 - 진교선 :: AWS Database Modernization Day 온라인
 
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정
 
[AWS Builders 온라인 시리즈] AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트
[AWS Builders 온라인 시리즈]  AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트[AWS Builders 온라인 시리즈]  AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트
[AWS Builders 온라인 시리즈] AWS 서비스를 활용하여 파일 스토리지 빠르게 마이그레이션 하기 - 서지혜, AWS 솔루션즈 아키텍트
 
Kafka basics
Kafka basicsKafka basics
Kafka basics
 
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
 
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016
AWS Lambda 100% 활용하기 :: 김상필 솔루션즈 아키텍트 :: Gaming on AWS 2016
 
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
 
Amazon Athena Capabilities and Use Cases Overview
Amazon Athena Capabilities and Use Cases Overview Amazon Athena Capabilities and Use Cases Overview
Amazon Athena Capabilities and Use Cases Overview
 
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 

Similar a Sqs and loose coupling

AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...QCloudMentor
 
“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the CloudAmazon Web Services
 
“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the CloudAmazon Web Services
 
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQS
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQSCloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQS
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQSwhite paper
 
RedisConf18 - Scalable Microservices with Event Sourcing and Redis
RedisConf18 - Scalable  Microservices  with  Event  Sourcing  and  Redis RedisConf18 - Scalable  Microservices  with  Event  Sourcing  and  Redis
RedisConf18 - Scalable Microservices with Event Sourcing and Redis Redis Labs
 
Best Features of Azure Service Bus
Best Features of Azure Service BusBest Features of Azure Service Bus
Best Features of Azure Service BusDaniel Toomey
 
Scalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudScalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudIan Massingham
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) TestingUjjwal Gupta
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) TestingUjjwal Gupta
 
Scalable web apps on AWS - Hebrew Webinar September 2017
Scalable web apps on AWS - Hebrew Webinar September 2017Scalable web apps on AWS - Hebrew Webinar September 2017
Scalable web apps on AWS - Hebrew Webinar September 2017Boaz Ziniman
 
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...Amazon Web Services
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusParticular Software
 
Tech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesTech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesIdeyatech
 
AWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAmazon Web Services
 
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017Amazon Web Services
 
Cloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersCloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersEitan Sela
 
Scalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL WebinaScalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL WebinaAmazon Web Services
 
Introduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationIntroduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationKnoldus Inc.
 

Similar a Sqs and loose coupling (20)

Mule sqs
Mule sqsMule sqs
Mule sqs
 
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
 
“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud
 
“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud“Spikey Workloads” Emergency Management in the Cloud
“Spikey Workloads” Emergency Management in the Cloud
 
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQS
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQSCloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQS
Cloud Computing With Amazon Web Services, Part 4: Reliable Messaging With SQS
 
RedisConf18 - Scalable Microservices with Event Sourcing and Redis
RedisConf18 - Scalable  Microservices  with  Event  Sourcing  and  Redis RedisConf18 - Scalable  Microservices  with  Event  Sourcing  and  Redis
RedisConf18 - Scalable Microservices with Event Sourcing and Redis
 
Best Features of Azure Service Bus
Best Features of Azure Service BusBest Features of Azure Service Bus
Best Features of Azure Service Bus
 
Scalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudScalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the Cloud
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) Testing
 
Message Queue (MQ) Testing
Message Queue (MQ) TestingMessage Queue (MQ) Testing
Message Queue (MQ) Testing
 
Scalable web apps on AWS - Hebrew Webinar September 2017
Scalable web apps on AWS - Hebrew Webinar September 2017Scalable web apps on AWS - Hebrew Webinar September 2017
Scalable web apps on AWS - Hebrew Webinar September 2017
 
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...
Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206)...
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service Bus
 
Tech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web ServicesTech Talk: Autoscaling with Amazon Web Services
Tech Talk: Autoscaling with Amazon Web Services
 
AWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWS
 
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017
Deep Dive on Microservices and Docker - AWS Summit Cape Town 2017
 
Cloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersCloud & Native Cloud for Managers
Cloud & Native Cloud for Managers
 
Scalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL WebinaScalable Web Apps Webinar September 2017 - IL Webina
Scalable Web Apps Webinar September 2017 - IL Webina
 
Messaging Systems on AWS
Messaging Systems on AWSMessaging Systems on AWS
Messaging Systems on AWS
 
Introduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationIntroduction to Azure Service Bus Presentation
Introduction to Azure Service Bus Presentation
 

Último

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Último (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Sqs and loose coupling

  • 1. SQS & Loose Coupling By Sandip Chaudhari Director, Beacon Edutech http://beaconedutech.com
  • 2. About Myself •  13+ years of professional experience in Software Industry •  Former CTO @ Krossover •  Director @ Beacon Edutech •  Panel Speaker in New York @ NYTech on Benefits of Cloud for Video and Image: https://www.nytech.org/events/cloud-video-image •  Blog: http://hashbulb.com •  Twitter: @sandipchaudhari •  Email: sandipchaudhari@gmail.com
  • 5. What is SQS? •  Amazon Simple Queue Service is a fast, reliable, scalable and fully managed queue service •  Amazon SQS enables asynchronous message-based communication between distributed components of an application
  • 6. SQS – What it can do? •  Amazon AWS SQS page: •  SQS makes it simple and cost-effective to decouple the components of a cloud application •  You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available •  With SQS, you can offload the administrative burden of operating and scaling a highly available messaging cluster, while paying a low price for only what you use.
  • 7. SQS – Major Features •  Redundant Infrastructure •  Multiple writers and readers •  Configurable settings per queue •  Variable message size (up to 256 KB) •  Access Control •  Delay Queues
  • 8. SQS – Message Visibility Timeout
  • 9. SQS – Message Visibility Timeout •  The visibility timeout clock starts ticking once Amazon SQS returns the message •  During that time, the component processes and deletes the message •  But what happens if the component fails before deleting the message? •  If your system doesn't call DeleteMessage for that message before the visibility timeout expires, the message again becomes visible to the ReceiveMessage calls placed by the components in your system and it will be received again •  If a message should only be received once, your system should delete it within the duration of the visibility timeout •  Each queue starts with a default setting of 30 seconds for the visibility timeout
  • 11. SQS Message Lifecycle •  Messages that are stored in Amazon SQS have a lifecycle that is easy to manage but ensures that all messages are processed. 1.  2.  3.  4.  A system that needs to send a message will find an Amazon SQS queue, and use SendMessage to add a new message to it A different system that processes messages needs more messages to process, so it calls ReceiveMessage, and this message is returned Once a message has been returned by ReceiveMessage, it will not be returned by any other ReceiveMessage until the visibility timeout has passed. This keeps multiple computers from processing the same message at once. If the system that processes messages successfully finishes working with this message, it calls DeleteMessage, which removes the message from the queue so no one else will ever process it. If this system fails to process the message, then it will be read by another ReceiveMessage call as soon as the visibility timeout passes
  • 12. SQS – Long Polling •  Benefit of long polling with Amazon SQS is the reduction of the number of empty responses, when there are no messages available to return, in reply to a ReceiveMessage request sent to an Amazon SQS queue •  Long polling allows the Amazon SQS service to wait until a message is available in the queue before sending a response •  So unless the connection times out, the response to the ReceiveMessage request will contain at least one of the available messages (if any) and up to the maximum number requested in the ReceiveMessage call
  • 13. SQS – Delay Queues
  • 14. SQS – Delay Queues •  Delay queues allow you to postpone the delivery of new messages in a queue for a specific number of seconds •  If you create a delay queue, any message that you send to that queue will be invisible to consumers for the duration of the delay period •  You can use CreateQueue to create a delay queue by setting the DelaySeconds attribute to any value between 0 and 900 (15 minutes) •  You can also turn an existing queue into a delay queue by using SetQueueAttributes to set the queue's DelaySeconds attribute
  • 17. Loose – Tight Coupling
  • 18. Loose – Tight Coupling
  • 19. Loose Coupling •  What if the whole leg was a single bone? •  Stiff and rigid? •  Or the joins in the leg bones were NOT looselycoupled?
  • 22. SQS and Loose Coupling
  • 23. SQS – Common Design Patterns •  Work Queues: Decouple components of a distributed application that may not all process the same amount of work simultaneously •  Buffer and Batch Operations: Add scalability and reliability to your architecture, and smooth out temporary volume spikes without losing messages or increasing latency •  Request Offloading: Move slow operations off of interactive request paths by enqueing the request •  Fanout: Combine SQS with Simple Notification Service (SNS) to send identical copies of a message to multiple queues in parallel for simultaneous processing
  • 24. Scalability – Cloud Scalability
  • 25. Concurrency and Load Sharing •  Simultaneous access to SQS complements concurrency •  Concurrent writes and reads promote load sharing •  Sharing load across machines / nodes opens the door to scalability
  • 26. Sync versus Async •  SQS offers completely asynchronous communication •  Source component can literally send and forget. It can immediately proceed to further processing without delay or wait for response •  Visibility timeout assures managed concurrency •  Visibility timeout ensures fail safety - each message is processed, even on failures. As long as the message is processed before retention expiry (14 days)
  • 27. Typical Use Cases •  Photo Processing - Instagram •  Number crunching and analytics for reporting •  Offline reports generation •  Video encoding - Krossover •  Email and SMS bulk messaging
  • 28. Case Study – Krossover Video Processing •  Burst loads – large simultaneous, concurrent uploads •  Video codec encoding is heavy processing •  Large and heavy video processing load demands load sharing •  Group of video encoding machines (upto 50) concurrently access the uploaded video-load queue •  Once video-load-message is read, the individual machine encodes the video before the message visibility timeout (set to 8 hours) •  Multiple such simultaneous encoding processes run on each machine (upto 8)