标准SQS与FIFO SQS的吞吐量,每条消息均具有唯一的groupId [英] Throughput in Standard SQS vs FIFO SQS with a unique groupId for every message

查看:84
本文介绍了标准SQS与FIFO SQS的吞吐量,每条消息均具有唯一的groupId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太关心事件的顺序,但是我希望消息只被处理一次.侦听SQS消息的lambda会将其存储在DynamoDB中,因此吞吐量非常重要,因为我有多个微服务(作为生产者)正在向此SQS编写消息,这些消息将由单个微服务读取.

I do not care much about the order of events but I would like the message to be processed exactly once. The lambda listening to SQS messages will store it in DynamoDB so throughput is pretty important as I have multiple microservices (as producers) writing messages to this SQS that will be read by a single microservice.

关于仅一次处理消息,这是FIFO队列支持的功能,但据说吞吐量不高.

About processing messages exactly once, that is something that FIFO queue supports but is said to have not a good throughput.

如果每个消息具有唯一的groupId,FIFO队列的吞吐量是否与标准队列相同?

Is the throughput of the FIFO queue the same as the Standard queue if each message has a unique groupId?

如果没有,我的下一个选择可能是使用"attribute_not_exists"在DynamoDB中存储消息时.

If not, my next option is probably to use "attribute_not_exists" in DynamoDB while storing the message.

其中哪些应该更好地工作?

Which of these should work better?

推荐答案

SQS交付保证为至少一次.您的应用程序必须设计为处理重复消息.

SQS delivery guarantee is at least once. Your application must be designed to handle processing duplicate messages.

我强烈建议您以这种方式构建您的应用程序.

I'd strongly recommend building your application this way.

如果必须一次只处理某种类型的数据,则需要一个高度一致的系统.考虑使用dynamodb和有条件的更新

If you must process some type of data exactly once, you need a strongly consistent system. Consider using dynamodb and conditional updates

这篇关于标准SQS与FIFO SQS的吞吐量,每条消息均具有唯一的groupId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆