I'm working on an application where each of our containerized service instances fetches data from an Amazon S3 bucket when they start up. We have quite a few containers—up to 2,000 in total—running on multiple EC2 hosts. Currently, when we update the data in S3, we have to stop and restart all the running containers to get the latest information, which isn't ideal. I'm considering using S3 event notifications sent to Amazon SNS so that each container can directly subscribe and receive updates in real-time. However, I'm worried about the operational complexity of having so many HTTP endpoints linked to SNS. I'd love to hear your thoughts on this approach or if there's a better solution!
4 Answers
You're good on the subscriber count for SNS; it supports a hefty limit of 12.5 million subscribers per topic. However, it’s crucial that your instances consistently perform as expected. You might want to look into AWS services that ensure your instances remain compliant with the latest updates from S3.
I've had some success with using a similar pattern through Netflix Hollow for Java. The trick is to maintain a reference for updates somewhere robust. I opted for Redis after testing a bit with Zookeeper, which was a bit unpopular. Relying on HTTP callbacks for each container could lead to missed updates if one node fails. Instead, consider implementing a polling mechanism using a database or something like Redis, even with a large number of containers—it’s typically more reliable.
I think your reasoning is spot on! Just dive in and see how it goes; that’s really the best way to assess its viability.
You should set up event notifications for changes in the necessary files. At startup, employ a caching mechanism to prevent flooding S3 with GET requests. You could run into throttling issues if you exceed 5,000 GET requests per second. Another option could be to create a head node responsible for fetching data, while other containers pull updates from it. Just be aware, there are plenty of ways to tackle this!

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Fix Not Being Able To Add New Categories With Intuitive Category Checklist For Wordpress
Get Real User IP Without Installing Cloudflare Apache Module
How to Get Total Line Count In Visual Studio 2013 Without Addons
Install and Configure PhpMyAdmin on Centos 7
How To Setup PostfixAdmin With Dovecot and Postfix Virtual Mailbox