What is the difference between node-cron and PM2 cron?
node-cron runs inside your app process (has access to models, cache, database connections) but is lost on restart. PM2 cron runs as separate scripts managed by PM2 (survives app crashes, has its own logs) but doesn't have app context. Use node-cron for app-integrated tasks, PM2 cron for independent tasks.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Cron vs setTimeout vs External Schedulers Choosing the Right Scheduling Method
Use setTimeout/setInterval for short intervals, node-cron for scheduled app tasks (cleanup, notifications, reports), PM2 cron for independent server tasks (backups, log rotation), system cron for OS-level maintenance, AWS EventBridge for serverless, and Bull/BullMQ for distributed job processing.
Use Bull/BullMQ when you need distributed job processing (multiple workers), persistence (survives restart via Redis), retry with backoff, priority queues, or rate limiting. Use cron for simpler scheduled tasks that don't need distribution or persistence.
EventBridge is a fully managed AWS service that can trigger Lambda functions, EC2, or SQS on a cron schedule. It survives everything, supports retry policies, and is ideal for serverless architectures. Use it when your app runs on AWS Lambda or needs multi-service orchestration.
Still have questions?
Browse all our FAQs or reach out to our support team
