Currently, I have a complex production NodeJS server that sends an e-mail to users through Sendgrid with the press of a button. This server is then deployed using Docker and Convox into a different production environment called 'production', and tested at a "staging" level.
I want to automate the functionality of sending e-mails to users by using the cron
NPM package. This cron job sends an e-mail to customers everyday automatically at a specified time. A problem I'm facing is the fact that the staging environment Node environment is the exact same as the production environment (both called 'production'). One possible solution is that I change the Docker/Convox configurations to have a separate Node environment for "staging" as well to prevent the cron job from running there.
However that got me thinking - what is the best practice to deploy cron-job services with functionality that is closely coupled to processes in my Node server?
Should the cron service be running on the same Node server? A concerned that was raised about this was that it may create a more "monolithic" instance with less fragmentation.
Should the cron service be running on a separate EC2 NodeJS or AWS Lambda?
I am trying to figure out the best way to structure the deployment of cron services so that it is extensible and scalable. In the future I wish to add more cron services with similar levels of functionality.
Aucun commentaire:
Enregistrer un commentaire