<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: George Yoshida</title>
    <description>The latest articles on DEV Community by George Yoshida (@quiver).</description>
    <link>https://dev.to/quiver</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1256713%2Fc1718be3-4e20-4ea9-9cce-441907456efa.jpeg</url>
      <title>DEV Community: George Yoshida</title>
      <link>https://dev.to/quiver</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/quiver"/>
    <language>en</language>
    <item>
      <title>Unraveling the Complexities of Amazon SQS Quotas: What You Need to Know</title>
      <dc:creator>George Yoshida</dc:creator>
      <pubDate>Wed, 04 Sep 2024 20:39:58 +0000</pubDate>
      <link>https://dev.to/quiver/unraveling-the-complexities-of-amazon-sqs-quotas-what-you-need-to-know-565b</link>
      <guid>https://dev.to/quiver/unraveling-the-complexities-of-amazon-sqs-quotas-what-you-need-to-know-565b</guid>
      <description>&lt;p&gt;When it comes to Amazon SQS (Simple Queue Service), understanding the quota limits can be a bit tricky, especially when using FIFO (First-In-First-Out). In this post, we'll dive deep into the differences between these queues, particularly focusing on the often-overlooked aspect of throughput limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQS Message Throughputs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Standard queue

&lt;ul&gt;
&lt;li&gt;nearly unlimited calls/sec/API&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;FIFO high-throughput

&lt;ul&gt;
&lt;li&gt;300 calls/sec/API/message group ID&lt;/li&gt;
&lt;li&gt;700,000 API/sec/queue # depends on the region&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;FIFO non-high-throughput

&lt;ul&gt;
&lt;li&gt;300 calls/sec/API/queue&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  SQS Queue Types: Standard vs. FIFO
&lt;/h2&gt;

&lt;p&gt;Amazon SQS offers two distinct types of queues:&lt;/p&gt;

&lt;h3&gt;
  
  
  Standard Queue
&lt;/h3&gt;

&lt;p&gt;This queue type offers nearly unlimited throughput and guarantees &lt;strong&gt;at-least-once&lt;/strong&gt; delivery. This means that each message is guaranteed to be delivered at least once and in some cases, messages may be delivered out of order. Due to this, it's essential to implement &lt;strong&gt;idempotent&lt;/strong&gt; workers in your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  FIFO Queue
&lt;/h3&gt;

&lt;p&gt;Designed to guarantee that messages are delivered &lt;strong&gt;exactly once&lt;/strong&gt; and &lt;strong&gt;in the exact order they are sent&lt;/strong&gt;. While this is critical for many applications, it comes with certain trade-offs, particularly in terms of throughput.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High-Throughput&lt;/strong&gt; FIFO(Recommended): In this mode, SQS assigns a dedicated partition to each message group ID within the queue. This partitioning allows for parallel processing of messages. Each partition can handle up to 300 messages per second per API action per message group ID. By increasing the number of message groups, you can scale the queue's throughput to meet higher demands. For more details, please refer to the official documentation, specifically the "Partitions and data distribution for high throughput for SQS FIFO queues" section in &lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html#partitions-and-data-distribution" rel="noopener noreferrer"&gt;"Enabling high throughput for FIFO queues in Amazon SQS."&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Queue's throughputs vary depending on regions, like 900,000 in N. Virginia and 91,000 in Tokyo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-High-Throughput&lt;/strong&gt; FIFO: This mode is more restrictive, with a maximum throughput of 300 messages per second per API action per queue. This limit can be a bottleneck in applications requiring high-volume message processing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-High-Throughput FIFO does not support per message group id throughput
&lt;/h2&gt;

&lt;p&gt;It might seem like you can choose between throughput measured &lt;strong&gt;per queue&lt;/strong&gt; or &lt;strong&gt;per message group ID&lt;/strong&gt; when using FIFO queues, but in reality, the non-high-throughput mode is limited to the former, while the high-throughput mode exclusively uses the latter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2209mpr3yhsvwy1cdws1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2209mpr3yhsvwy1cdws1.png" alt="create fifo queue from the console" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In fact, if you try to create a FIFO queue in non-high-throughput mode with per-message group ID throughput, you will encounter errors similar to the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;InvalidAttributeValue: Invalid value for the parameter FifoThroughputLimit. Reason: To set FifoThroughputLimit to perMessageGroupId, the DeduplicationScope must be messageGroup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/enable-high-throughput-fifo.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/enable-high-throughput-fifo.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>sqs</category>
      <category>messageque</category>
      <category>fifo</category>
    </item>
  </channel>
</rss>
