This might seem like a basic question, but I could not find any documentation :
What is the difference between forking & spawning a node.js process? I have read
TLDR
Spawn
When a spawn is created - It creates a streaming interface between parent and child process.
streaming interface means - buffering data in binary format in ONE TIME
Fork
When a fork is created - It creates a communication channel between parent and child process
communication channel means - messaging
Difference
Well both look kind of doing same data transfer, Except below difference
spawn will be useful when you want to do continuous data buffer in binary/encoding format , Eg - Transfer 1gb video file,image,log files in ONE TIME
fork will be useful when you want to do messaging
Eg - JSON or XML data messaging
Conslusion
spawn should be used for streaming big data/files/images FROM spawn process TO parent process
fork should be used for doing Json/Xml messaging .