I would be very gratefull if someone could answer my question. I'm new to nodejs. Doing app in meteor. Everything is fine, mongo etc. But when I end huge crud...I will need to parse some xml apis, scrape some websites. All as backend tasks done via cron etc. My question is...I don't see any examples of such backends in meteor. I see using npm libs. Is this the only path to follow? Also meteor writes mongo's ids as strings. While php writes as objectid. If I would use npm will it write as objectid? Will it do harm? Overall question is...to do parsing backend in meteor the npm are the good path?
Asked
Active
Viewed 200 times
1 Answers
1
I quote @Dan Dascalescu in his excellent answer to another question:
There are several packages to run background tasks in Meteor. From the simplest to the most involved:
- super basic cron packages: cron, easycron
- percolatestudio:synced-cron
- cron jobs distributed across multiple app servers
- queue-async - minimalistic async (see below), written by D3 author Mike Bostock
- peerlibrary:async - wrapper for the popular async package for Node.js and the browser. Offers over 20 functions (map, reduce, every, filter etc.) and supports powerful control flow (serial, parallel, waterfall etc.); see also this example.
- artwells:queue - priorities, scheduling, logging, re-queuing. Queue backed by MongoDB.
- vsivsi:jobCollection
- schedule persistent jobs to be run anywhere (servers, clients). I used this to power the RSS feed aggregation at a financial news aggregator startup (StockBase.com).
- differential:workers
- Spawn headless worker meteor processes to work on async jobs
Packages I would recommend caution with:
- PowerQueue - queue async tasks, throttle resource usage, retry failed. Supports sub queues. No scheduling. No tests, but nifty demo. Not suitable for running for a long while due to using recursive calls.
- Kue - the priority job queue for Node.js backed by redis. Not updated for Meteor 0.9+.

Community
- 1
- 1

Billybobbonnet
- 3,156
- 4
- 23
- 49
-
Thank you so much for answer. Could you kindly direct me in some direction about how to correctly make backend. Some example? I'm quite new do nodejs world. I know asp.net/php as web solutions. – rymoholiko Aug 06 '15 at 09:59
-
percolatestudio:synced-cron is one of the most used packages. You will find resources on how to use it. It should cover your CRON jobs needs and beyond. A word of warning, these are not npm packages but meteor "smart" packages (you can't add npm packages to a meteor app by default). You just have to install it by running in console `meteor add percolatestudio:synced-cron` in your project folder. Besides the package readme, you can check on this for more info: http://richsilv.github.io/meteor/scheduling-events-in-the-future-with-meteor/ – Billybobbonnet Aug 06 '15 at 10:19