Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing SQS

Introducing SQS

Amazon SQS is a fast, reliable, scalable, fully managed message queuing service. SQS makes it simple and cost-effective to decouple the components of a cloud application.


Michael Wittig

April 14, 2016


  1. Introducing SQS

  2. Hello! I am Michael Wittig I like to build distributed

    but simple systems You can find me at @hellomichibye
  3. 1. WHAT IS SQS? Introducing Amazon Simple Queue Service

  4. “ Amazon SQS is a fast, reliable, scalable, fully managed

    message queuing service. SQS makes it simple and cost- effective to decouple the components of a cloud application. https://aws.amazon.com/sqs
  5. What is SQS? Distributed Queue System Scales automatically Fault Tolerant

    Managed Service
  6. Pricing $0.50 per 1 million requests 1 to 10 messages,

    up to a maximum total payload of 256KB per request payload of 64KB is billed as 1 request.
  7. 2. WHY USING SQS? Motivation and Use Cases

  8. Loose Coupling Decouple services to increase fault tolerance and allow

  9. Well Known Approach Load Balancer

  10. Synchronous Answer requests immediately Decoupling Asynchronous Process requests sometime

  11. Use Cases Scanning Git repositories (AutoScout24) Buffering DynamoDB writes (Shazam)

    Recording activity within mobile games (Scopely) Invalidating multi-region cache ...
  12. Asynchronous Decoupling

  13. 3. HOW DOES SQS WORK? Looking Under The Hood

  14. Parallelism Multiple clients acting as readers or writes are supported.

  15. Queue Named bucket containing messages. Terms Message Can be written,

    read, and deleted from queue.
  16. Limitations Message order not guaranteed At least once delivery Eventual

  17. Why? Distributed System

  18. SQS Architecture Source: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/DistributedQueues.html

  19. Solves the problem of “At least once” delivery Idempotence

  20. 4. MESSAGE LIFECYCLE Deep Dive

  21. Simplified Lifecycle Read Delete Create

  22. Lifecycle (1) Source: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MessageLifecycle.html

  23. Lifecycle (2) Source: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MessageLifecycle.html

  24. Lifecycle (3) Source: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MessageLifecycle.html

  25. 5. COMPARISON Compare with other solutions

  26. Kinesis + Kafka Shards for scaling Message order guaranteed within

    partition key Client manages reading position
  27. RabbitMQ Full-featured message broker Flexible routing of messages

  28. 6. ADVANCED TOPICS Even more insights into SQS

  29. Dead Letter Queue Collecting failed messages Message reached Visibility Timeout

    several times React to messages in DLQ Trigger alerting Forward to human ...
  30. Delay Message Message stays invisible after being inserted into queue

    Configurable based on … Message Queue
  31. Long Polling Reduce number of empty read responses Wait between

    1 and 20 seconds Configurable based on … Read request Queue
  32. Thanks! Any questions?

  33. Credits Special thanks to all the people who made and

    released these awesome resources for free: Presentation template by SlidesCarnival Photographs by Unsplash