简体   繁体   中英

AWS - Lambda Scheduler to invoke multiple lambda instances

I need to poll a DB every 5 minutes , get the list of ids from the db and make service call to external services for each an every id to get additional information and store the data in db. I thought of building a lambda scheduler that would fetch the list of ids from db and invoke 1 lambda instance for each and every id fetched from db. The lambda instance which is invoked by the scheduler will call the external service for the specific id that it has received from the scheduler and it will persist the info in a db. Is this a feasible pattern for the problem or are there any other patterns available for implementing this use case in aws?

My design would be to use a cloudwatch event rule that fires the first lambda function every 5 minutes to gather the list of ids.

That lambda function would the send a message for each id that needs to be processed to an SNS topic, and then I would subscribe the second lambda function to that SNS topic so it would receive the id/message and do the required work.

https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM