We have web application used by customers and they have option to create reports. Report contains email and scheduled time(Ex: every day, 9 a.m.).
When the scheduled time matches the current time web app does some work and sends result to the email.
I have one requirement where I need to implement scalable cron architecture on top of swf.
My needed architecture looks like below:
From I read about SWF service is we can create cron jobs and SWF autoscales. How can I create scalable cron microservice using SWF?
Open to any suggestions...
P.S. Web app is written in nodejs, it will be very good to write microservice in nodejs.
Update 1: After spending some time researching possible solutions, I found https://github.com/capside/CloudCron project. But it relies on cloudwatch event. For many scheduled tasks it may charge a lot IMO.
Update 2: Banjo Obayomi suggested to use Lambda function with SQS and CWE.
Solution 1:
Limitations: We can only create 100 CWE rules per region. It means webapp can not generate more than 100 reports with scheduled date.
I did not find the exact solution to my problem, but found another way to achieve my goal with CloudWatchEvent and SQS services.
Instead of receiving individual cron SQS messages from cron microservice with params, and doing analyzing, notification work. We moved logic to backend app like below: