TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

AWS SNS vs. SQS – Main Differences

123 点作者 adrianomartins将近 3 年前

11 条评论

traspler将近 3 年前
Pretty good and simple explanation, thanks a lot!<p>There are a couple of things I‘m left wondering: When the SNS is used to notify through Email, Push or SMS then even in the fan-out pattern, no SQS is involved on these paths, right? (seems to me that only on A2A paths SQS would be involved, at least from the diagrams) So is there anything else to help with reliability there that the notifications actually do go out?<p>For workloads where you e.g. want to alert users through different means, not every user might have the same options selected, e.g. some only Push and others SMS and EMail; would that be modeled through different topics which have different combinations of subscribers attached (some only 1) or would it be better to skip SNS and push multiple messages to different queues directly?
评论 #31528425 未加载
评论 #31529939 未加载
评论 #31528420 未加载
Nouser76将近 3 年前
&gt;SQS has a many-to-one relationship. You can send messages to a queue from many different producers but only one consumer can be defined. A consumer is another application, most often some compute instances such as Lambda, EC2, or Fargate.<p>My understanding is that you can have multiple consumers of an SQS through the use of visibility timeouts[0]. Once a message is consumed it is as if that message doesn&#x27;t exist for all other consumers until it reaches a timeout period or is marked done by that consumer. You can also manually mark a message as being ready for other consumers. This moves the message back into the queue for the other consumers to see.<p>I&#x27;m going to be linking this article to my team. We&#x27;ve been talking about moving to SNS&#x2F;SQS&#x2F;etc. and this article helps understand the use cases and distinctions better.<p>[0]: <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AWSSimpleQueueService&#x2F;latest&#x2F;SQSDeveloperGuide&#x2F;sqs-visibility-timeout.html" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AWSSimpleQueueService&#x2F;latest&#x2F;SQS...</a>
评论 #31529455 未加载
评论 #31529149 未加载
评论 #31529999 未加载
评论 #31529159 未加载
SideburnsOfDoom将近 3 年前
In my experience, SQS queues attached to a SNS topic is a common configuration. Each subscribed queue has a worker or &quot;worker group&quot; that gets a copy of all messages.<p>The topic has &quot;zero or more&quot; subscribed queues, and when sending to the SNS topic, you don&#x27;t need to know how many subscribers there are right now.<p>In many cases, it&#x27;s more a flexible equivalent to write to a SNS topic; not directly to a SQS queue.<p>The article calls this &quot;the fanout pattern&quot;
评论 #31529148 未加载
评论 #31529302 未加载
__david__将近 3 年前
I&#x27;m confused about calling SQS a many to one service. One of the use cases I&#x27;ve seen (and that is endorsed by AWS) is a worker queue, where someone puts a job into the queue and there&#x27;s a whole bunch of workers waiting. One of the workers grabs a message, processes it and then deletes it. That seems like a many to many service to me… Or maybe a many-to-one-of-many service?
评论 #31533011 未加载
jakswa将近 3 年前
If you&#x27;re coming from a ruby&#x2F;sidekiq&#x2F;redis land, there is a sidekiq-inspired repo trying to make the transition easy <a href="https:&#x2F;&#x2F;github.com&#x2F;ruby-shoryuken&#x2F;shoryuken" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ruby-shoryuken&#x2F;shoryuken</a>
lysecret将近 3 年前
Good writeup. This is how I like my advertisement ;). Also pretty interesting, how he built the product: <a href="https:&#x2F;&#x2F;sandro.volpee.de&#x2F;series&#x2F;serverlessq-bip" rel="nofollow">https:&#x2F;&#x2F;sandro.volpee.de&#x2F;series&#x2F;serverlessq-bip</a>
评论 #31529286 未加载
kposehn将近 3 年前
I really liked this article because it explained the differences in a very understandable and relatable way, and also because it sold me on ServerlessQ.<p>This is a great example of content marketing that uses a question to both answer and impart value in a very logical and compelling way. Through understanding the differences between SQS and SNS the reader will know how to use those in the future, get a clearer idea of the complexity, and be presented with a much simpler and still full-featured alternative at the end. Well done.
评论 #31537975 未加载
philliphaydon将近 3 年前
SQS can push to lambda without polling.
评论 #31527677 未加载
评论 #31533208 未加载
rbluethl将近 3 年前
Great writeup and comparison. Also, serverlessq looks really interesting. I&#x27;ve struggled with queues quite often in the past – can&#x27;t wait to give this one a try.
评论 #31528457 未加载
andrew_将近 3 年前
FWIW you can wire an SNS topic directly to a Lambda - But watch out for frequency rules around that setup. Too many posts to the SNS Topic and you&#x27;ll run into rate limits and dropped messages. (This is also why most suggest going to a queue first)
评论 #31530139 未加载
101011将近 3 年前
Nice writeup! It&#x27;d be helpful to mention that SNS allows you to setup a retry policy and also allows for you to configure a DLQ when retries are exhausted.