I'm developing a Node.js marketplace application for buying and selling items, and my backend is hosted on EC2. I need to manage tasks like resizing images, adding watermarks, and performing NSFW checks. Since image processing tasks can take some time and users won't mind waiting for their ads to publish, I'm considering using AWS Lambda for offloading just the image processing part. This would be triggered through S3 or SQS, while keeping the rest of my API on EC2. I'd like to know if this is a common and sensible approach, or if it's introducing unnecessary complexity when compared to using EC2 workers. Cost is a major concern for me right now, rather than speed. Additionally, I'd appreciate any advice or alternatives for setting up this kind of system.
5 Answers
I suggest breaking each check into its own Lambda function and orchestrating them with a Step Function. That way, you'll have clear insights on cost per function, helping you track anomalies effectively.
Image processing is definitely one of the ideal cases for using Lambda! It can scale well with your workload and you’ll find plenty of guides online to help you set everything up.
I think you'll find that using Lambda could end up being more expensive than sticking with small reserved instances or Docker containers on EC2. It’s usually more cost-effective in the long run.
Have you considered using Cloudflare Images? It's perfect for all the tasks you mentioned and even has a generous free plan. Running sharp on Lambda might not be the most efficient choice.
Microservices are the way to go! Just pick whatever works best for you now and be flexible for future changes. I often mix different resources depending on what fits my needs.

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