[awsマイスターシリーズ] amazon sqs / sns

Download [AWSマイスターシリーズ] Amazon SQS / SNS

Post on 26-Jan-2015

120 views

Category:

Technology

0 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

  • 1. re:G ene AWS Amazon SQS / SNSrate 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

2. Agenda ! Amazon SQS SQS SQS! Amazon SNS SNS SNS Mobile Push! SQS/SNS ! ! Appendix2 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 3. ! 3 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 4. Introduction ! by Randy Shoup (eBay) ! 4 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 5. Amazon SQS5 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 6. Amazon SQS (Simple Queue Service) ! ! Queue6 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 7. SQS ! 1 20ms7 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 8. SQS ! 8 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 9. SQS ! 9 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 10. SQS ! 10 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 11. SQS ! 11 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 12. SQS ! 12 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 13. SQS ! 30 Visibility Timeout Inflight Visibility Timeout 13 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 14. SQS ! 14 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 15. SQS ! 30 1 15 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 16. SQS ! A B C 16 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 17. SQS ! A C B 17 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 18. SQS ! C A B 18 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 19. SQS ! 110 x 10 x 10 x 10 19 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 20. SQS ! 110 x 10 x 10 x 10 20 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 21. ! ! ! ! ! SQS ! 4 6014 ! 120,000Inight 120,000OverLimit ! 256KB ! 21 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 22. SQS ! 1 2 ! 22 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 23. SQS23 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 24. SQS Long Polling ! ReceiveMessage 1 ! ! ReceiveMessageWaitTimeSeconds Polling 02024 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 25. Long PollingShort Polling ! Long Polling Polling Polling Polling ! Short Polling RecieveMessage Long Polling PollingPolling 25 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 26. SQS Delay Queue ! 0900 Visibility Timeout26 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 27. SQS Message Timers ! 0 Message TimersDelay Queue Send Message Request Message Timers 60 Delay Queue 30 27 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 28. SQS Dead Letter Queue ! Dead Letter Queue Dead Letter Queue Dead Letter Queue28 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 29. SQS Batch API actions ! 110 SendMessageBatch DeleteMessageBatch ChangeMessageVisibilityBatch! 1256KB SendMessageBatch 256KB29 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 30. Client-side BueringRequest Batching ! Client-side AmazonSQSBueredAsyncClient! SendMessage DeleteMessage ChangeMessageVisibility! 10 ! BatchSQS 30 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 31. SQS ! SQS ! Batch API110 AWSSDK for Java50 MaxConnectionsAmazonSQS sqsClient = new AmazonSQSClient(credentials, new ClientConfiguration().withMaxConnections( producerCount + cousumerCount));31 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 32. SQS ! JSON { "Version":"2012-11-05", "Id":"cd3ad3d9-2776-4ef1-a904-4c229d1642ee", "Statement" : [ { "Sid":"1", "Effect":"Allow", "Principal" : { "aws": "111122223333" }, "Action":["sqs:SendMessage","sqs:ReceiveMessage"], "Resource": "arn:aws:sqs:us-east-1:444455556666:queue2", "Condition" : { "IpAddress" : { "aws:SourceIp":"10.52.176.0/24" }, "DateLessThan" : { "aws:CurrentTime":"2009-06-30T12:00Z" } } } ] AWS SendMessage AWS EC2 32} 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 33. Amazon CloudWatchSQS ! NumberOfMessageSentSentMessageSizeNumberOfMessageReceivedReceiveMessageNumberOfEmptyReceivesReceiveMessageNumberOfMessagesDeletedApproximateNumberOfMessage DelayedDelay Delay QueueDelay ApproximateNumberOfMessage VisibleApproximateNumberOfMessage NotVisible visibility winodwend33 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 34. SQS Best Practice(1) ! 1 10! ! Long Polling 1 2034 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 35. SQS Best Practice(2) ! SQS1! SQS! Polling supervisordpolling 35 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 36. SQS ! ID ID URI! S3SQS 36 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 37. SQS ! 100 ! SQS1000.50 USD 10.0000005 USD ! 0 USD 371GB/ 0 USD 10TB / 0.201 USD GB 40TB /0.158 USD GB 100TB /0.137 USD GB 350TB /0.127 USD GB 350TB SQSEC2 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 38. Amazon SNS38 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 39. Simple Notication Service ! ! ! 2. 1.Topic HTTP(S) Amazon SNS EMAILPublish PublisherTopicSQSMobile Push Subscriber39 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 40. Amazon SNS ! : 100 Email/Email-JSON: 1,000 HTTP/HTTPS: