database - Batch Processing in MySql and Node.js -
i have set of 100 rss links parse every 5/30/45 minutes. of time records received might same yes surely there might additional records added might vary.
records shouldn't repeated in database (no duplicate records). if record exists, check whether record same, if different update else reject it, if not exits insert.
possible ways:
- from node.js in loop keep check , insert kill application since there more records.
- write stored procedure.
- batch processing.
i don't have idea batch processing if can please share information regarding batch processing in mysql. how upload bulk data sample code helpful.
if, regular rss feeds, feed adds new records , doesn't change existing ones, think straight-forward solution to:
retrieve latest stored record of feed mysql database
go through records in rss feed, starting recent 1 , moving in time
match records in feed 1 retrieved mysql database. if matches, stop going through feed , add records newer 1 database.
depending on update frequency, should not keep app busy long per feed.
on other hand, if want account edits in existing records could:
use streams parse , asynchronously process data immediatey you're loading it.
if feeds aren't large in size, parse records array , use queue process them 1 one. memory may concern here though, if feeds relatively large.
Comments
Post a Comment