AdelmoMezzi
AdelmoMezzi

Reputation: 104

Is there a good pattern to send a message between AWS Lambdas

My use case is the following. I have 5 lambdas. They need to talk to each other. I've heard that it can be done with SNS but also SNS and SQS. What is the difference, why not call lambdas only from one another directly?

Upvotes: 1

Views: 127

Answers (2)

shuraosipov
shuraosipov

Reputation: 161

You can also use AWS Step Function which is a serverless function orchestrator that makes it easy to sequence AWS Lambda functions and multiple AWS services.

You can check out getting started guide here - https://docs.aws.amazon.com/step-functions/latest/dg/getting-started.html

Upvotes: 0

ziGi
ziGi

Reputation: 848

It's possible to design durable and scalable applications using SNS-SQS AWS pattern. You can do this by having an SNS topic to which lambda A posts then the SNS triggers directly SQS which is a queue. In that way if you have high volume messages they will be processed sequentially.

Take care that the SNS and SQS can trigger more than once.

For more info check the article here: https://aws.amazon.com/blogs/compute/designing-durable-serverless-apps-with-dlqs-for-amazon-sns-amazon-sqs-aws-lambda/

Upvotes: 1

Related Questions