AWS Lambda vs AWS step function

时间:2019-01-09 22:03:31

标签: amazon-web-services amazon-s3 aws-step-functions

I am designing an application for which input is a large text file (size ranges from 1-30 GB) uploaded to S3 bucket every 15 min. It splits the file into n no of small ones and copy these files to 3 different S3 buckets in 3 different aws regions. Then 3 loader applications read these n files from respective s3 buckets and load the data into respective aerospike cluster.

I am thinking to use AWS lambda function to split the file as well as to load the data. I recently came across AWS step function which can also serve the purpose based on what I read. I am not sure which one to go with and which will be cheaper in terms of pricing. Any help is appreciated.

Thanks in advance!

2 个答案:

答案 0 :(得分:4)

步骤功能非常适合协调涉及多个预定义步骤的工作流程。它可以很好地完成并行任务和错误处理。它主要使用Lambda函数执行每个任务。

根据您的用例,步进函数听起来很合适。就价格而言,它在Lambda之上增加了非常小的额外费用。根据您的描述,我怀疑您是否还会注意到额外的费用。您需要根据要使用的number of "state transitions"进行评估。当然,您还必须为Lambda调用付费。

答案 1 :(得分:3)

Lambda和Step功能就像楼层和每个楼层的步骤。您不能用另一个替换。

Lambda正在计算,步骤功能将它们带到所需的步骤。

Youtube视频解释得很好:https://www.youtube.com/watch?v=Dh7h3lkpeP4

再次类推,您可以在下一层传递多个计算(lambda),然后再将其传递到下一层。

其中一个示例如下所示。

用例: https://john.soban.ski/transcribe-customer-service-voicemails-and-alert-on-keywords.html

enter image description here

希望有帮助。