DEV Community

Discussion on: Processing CPU-intensive Jobs in NodeJS

Collapse
 
ba7er profile image
Abdelellah

Have you thought about using streams in here?
Not sure if this is relevant but recently i had to write a script to save thousands of records to a database after reading them from a CSV file and streams came in handy

Collapse
 
eunovo profile image
Oghenovo Usiwoma • Edited

I had to work with Excel files that contained images. Parsing the excel file itself was CPU intensive. Streams might work well with CSV files where you can just read each line and process it.

Collapse
 
klvenky profile image
Venkatesh KL

That's definitely right. Streams would work like a charm in this case. However we have to be careful if want to do something like a transaction & maintain consistency.