DEV Community

Discussion on: Node.js vs PHP

Collapse
 
perttisoomann profile image
Pert Soomann

Not played around with Node that much, but I got the feeling, correct me if I'm wrong, PHP runs every request independently, so breaking code on one URL won't affect other visitors, while on Node project you could crash the whole service, and would need to restart it for the whole site/app to be available again?

Collapse
 
vardiak profile image
Nathan

Basic error handling can prevent this from happening. It's native if you are using Express.

  • microservices make that even less possible.
Collapse
 
kejtenoviot_sin profile image
Кејтеновиот син ♦

You can make micro services with nodejs so that if one crashes, they don't all crash.

Collapse
 
phunckys profile image
теле • Edited

Both replies to the original comment are workarounds. PHP provides this out of the box, while with Node.js you need to create an architecture around handling such cases.