AWS Lambda删除的SQS轮询器有哪些缺点? [英] What are the drawbacks of SQS poller which AWS Lambda removes?

查看:117
本文介绍了AWS Lambda删除的SQS轮询器有哪些缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的体系结构:-

I have an architecture which looks like as follows:-

多个SNS->(带有Poller的AWS Lambda或SQS)??? -> Dynamo Db

Multiple SNS -> (AWS Lambda or SQS with Poller)??? -> Dynamo Db

因此,基本上有多个SNS已通过Poller订阅了AWS Lambda或SQS,并且该事件将数据推送到Dynamo Db.

So, basically multiple SNS have subscribed to AWS Lambda or SQS with Poller and that thing pushes data to Dynamo Db.

但是这个吗?事情在两者之间做了很多信息转换.因此,现在对于这种情况,我可以将AWS Lambda或SQS与Poller一起使用.借助AWS Lambda,我可以在Lambda函数中进行转换,而对于具有Poller的SQS,我可以在Poller中进行转换.使用AWS Lambda,我看到一个问题,因为转换非常复杂(规则很多),所以代码会变得很大,因此我正在考虑使用SQS.但是在最终确定SQS之前,我想知道AWS Lambda删除了SQS的缺点吗?

But this ? thing do lot of transformation of message in between. So, now for such case, I can either use AWS Lambda or SQS with Poller. With AWS Lambda, I can do transformation in Lambda function and with SQS with Poller, I can do transformation in Poller. With AWS Lambda, I see one problem that code would become quite large as transformation is quite complex(has lot of rules), so I am thinking to use SQS. But before finalising on SQS, I wanted to know of the drawbacks of SQS which AWS Lambda removes?

请帮助.让我知道您是否需要更多信息.

Please help. Let me know if you need further information.

推荐答案

您的问题内容不多,因此我将尝试解释您的需求.

Your question does not contain much detail, so I shall attempt to interpret your needs.

选项1:SQS轮询

  • 信息发送到Amazon SNS主题
  • SQS队列已订阅SNS主题
  • 在Amazon EC2实例上运行的应用程序定期轮询 SQS队列以请求消息
  • 如果有消息可用,则将消息中的数据转换并保存到 Amazon DynamoDB
  • Information is sent to an Amazon SNS topic
  • An SQS queue is subscribed to the SNS topic
  • An application running on Amazon EC2 instance(s) regularly poll the SQS queue to ask for a message
  • If a message is available, the data in the message is transformed and saved to an Amazon DynamoDB table

如果转换需要很长时间才能完成,则此方法很好.可以根据队列中的工作量来缩放EC2实例的数量.可以同时接收多封邮件.这是一种传统的基于消息的方法.

This approach is good if the transformation takes a long time to process. The number of EC2 instances can be scaled based upon the amount of work in the queue. Multiple messages can be received at the same time. It is a traditional message-based approach.

选项2:使用Lambda

  • 信息发送到Amazon SNS主题
  • AWS Lambda函数已订阅SNS主题
  • 将消息发送到SNS主题时,会调用一个Lambda函数
  • Lambda函数转换消息中的数据并将其保存到 Amazon DynamoDB
  • Information is sent to an Amazon SNS topic
  • An AWS Lambda function is subscribed to the SNS topic
  • A Lambda function is invoked when a message is sent to the SNS topic
  • The Lambda function transforms the data in the message and saves it to an Amazon DynamoDB table

AWS Lambda函数的执行时间限制为五分钟,因此,只有在该时间范围内可以完成转换过程的情况下,此方法才有效.

AWS Lambda functions are limited to five minutes of execution time, so this approach will only work if the transformation process can be completed within that timeframe.

不需要服务器,因为Lambda将自动并行运行多个功能.如果不执行任何工作,则不会执行Lambda函数,也不会收取任何计算费用.

No servers are required because Lambda will automatically run multiple functions in parallel. When no work is to be performed, no Lambda functions execute and there is no compute charge.

在两个选项之间,使用 AWS Lambda效率更高且可扩展性,但是它可能会因您的特定工作负载而有所不同.

Between the two options, using AWS Lambda is much more efficient and scalable but it might vary depending upon your specific workload.

这篇关于AWS Lambda删除的SQS轮询器有哪些缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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