- Pre crafted collection of objects (in RAM) =>
- Transform =>
- store in file [end]
- Async Iterator crafted objects (simulated external stream) =>
- Transform =>
- store in file [end]
- Async Iterator crafted objects (simulated external stream) =>
- Transform data (prepare for CSV format) =>
- Transform to CSV =>
- store in file [end]
- Sync Iterator crafted objects (Speed demo up) =>
- Transform data (prepare for CSV format) =>
- Transform to CSV =>
- store in file [end]
- Sync Iterator crafted objects (Speed demo up) =>
- Transform data (prepare for CSV format) =>
- Transform to CSV =>
- Compress GZip =>
- store in file [end]
-
Real basics of Streams
- listeners
- back pressure thingies
- memory / cpu etc...
-
What not to do!
- buffer files completely in RAM, then store!
- write to local temp file (often slow, and solvable by implementing streams api)
- Prepare big chunks of collections in ram (use iterators pl0s)
-
From MongoDB Stream (simple find) => stuff
-
From MongoDB Stream (aggregations) => stuff
-
From SQL ;) => stuff
-
Something with encryption
-
Arnold Generator
-
Imagary/Video streaming to front end
-
UDP stream (imagery / data)
-
Maybe incorporating socket.io
- Intercept traffic in a stream
- Simulate/TEST an error somewhere inside the stream@example``````
(See: https://clinicjs.org/)
- npm i -g clinic`
clinic doctor -- node ./dist/index.js
This project does logging to a local file : output.log
If you want to see what's happening: tail -f output.log
- https://blog.risingstack.com/the-definitive-guide-to-object-streams-in-node-js/
- https://nodejs.dev/en/learn/nodejs-streams/#how-to-create-a-readable-stream
- https://jscomplete.com/learn/node-beyond-basics/node-streams
- https://nodejs.org/api/process.html#processstdout (about blocking the event loop)
- https://thenewstack.io/node-js-readable-streams-explained/
- https://www.knowledgehut.com/blog/web-development/compression-decompression-of-data-using-zlib-in-Nodejs
- https://medium.com/@hemitrana1409/node-js-zlib-module-a6c2d8b9c195
- https://clinicjs.org/