'How could we handle massive AWS SNS Mobile push notifications (with dynamodb and lambdas)?

We save a huge list of followers in DynamoDB (more than 10K) and we need to send a push notification to each follower each time an item is created. And i am worried that (NodeJS) lambdas only have a limit of 15 minutes, not enough time to query the list from DynamoDB and send all SNS push notifications one by one.

I think i might be tackling the issue without the correct tools, any suggestions?



Solution 1:[1]

You shouldn't need to query DDB nor send SNS notifications for each subscriber.

You should have 1 SNS topic and when you add a subscriber to your DDB list, you subscribe them to the SNS topic.

Now sending a message to all 10K subscribers is just sending a single message to the SNS topic.

Edit
Since you've commented that the item you're sending the notification about is created in DDB. Then what you want to do is enable DDB Streams and have a lambda process the stream and send the single message to SNS; which will then go out to the 10K subscribers.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1