DEV Community

Discussion on: Node.js vs PHP

Collapse
 
bgadrian profile image
Adrian B.G.

I had to do a comparison for a new startup actually and (unfortunatelly) I had to choose between these 2 languages, and putting aside the local market available developers, PHP really didn't brought any advantage on the table.

It may behave better with *SQL databases (I found this reason as stated by other devs, but I haven't seen any data on it), but rather then this NodeJS is better at ecosystem, latency, re usage of the code between frontend/backend, and a few others. I will have to search my paper on it.

But between NodeJS and compiled back end languages like Go,Rust and Java enterprise Apps I really don't see PHPs place in any med/large app/team in 2018 and beyond sorry. I think it is still popular because of the sheer amount of developers that know PHP.

Packages

I have not played with composer in 5yrs, but I bet is better than the NPM as a tool and as an ecosystem (which is a total mess).

However, the main advantage of PHP when it comes to working with data is that it’s compatible with all the hosting services.

No real project/customer that has more then 3$ monthly will use a shared hosting, so it is an invalid argument. For more serious hostings managed env nodeJS has more supported environments actually (including Cloud Functions).

handling asynchronous I/O operations isn’t something that can make Node.js a winner in Node.js vs PHP performance competition.

Sure thing it is, is actually why Node will win in intensive web apps. Should I remember you that I/O include any DB and API query?

They require a certain run-time environment to be used for scripting

Even if PHP 7 is a lot better then the previous, let's just say that I trust V8 performance team more than I trust the PHP devs on the long run.

across most popular content management systems

I cannot believe you mentioned CMS and Wordpress in the "Scalability" subtitle.
PHP-FPM is easier to scale then nodeJS that is for sure and well supported. For nodeJS a simple similar alternative would be single-core machines with auto-scaling LB.

Collapse
 
thinsoldier profile image
thinsoldier

No real project/customer that has more then 3$ monthly will use a shared hosting, so it is an invalid argument.

There are hundreds of thousands of freelancers living acceptably comfortable lives by having dozens of clients who are willing to pay a few hundred dollars as-needed but unwilling to pay any kind of monthly fee. And even if they did, not everyone has the time to be an expert in all the areas of expertise they already dabble in and then have to learn to do their own devops on top of that. They'd rather pay monthly for real professionals to manage their server for them IF their clients really needed that, but most of their clients do not need it.