DEV Community

Cover image for Node.js vs PHP: Which is better for backend development?

Node.js vs PHP: Which is better for backend development?

indumathysk on December 17, 2021

There are many facets of web development that are constantly evolving. Likewise, the app development and programming communities have to contend wi...
Collapse
 
codingjlu profile image
codingjlu

Great article. However, I'd disagree with the second con you mentioned about NodeJS—in my opinion NodeJS offers a wide variety of very high-quality libraries that is dependable and well-coded. NodeJS' official package manager boasts almost 2 million published NPM packages, a lot in my opinion. Sure, there are some packages that do something useless or are full of bugs, but I'd say that many are very well-crafted.

Collapse
 
hireindianprogrammers profile image
indumathysk

Thanks. Keep reading

Collapse
 
jlrxt profile image
Jose Luis Ramos T. • Edited

Node.js no es un lenguaje, solo es un entorno para el lenguaje Js.
PHP si es un lenguaje. Estoy en desacuerdo cuando enfrentan una tecnología contra otra.

La función de un entorno es maximar y ahorranos pasos, memoria, líneas de código, cache, rendimiento.

Pero no puede ser comparado un entorno con un lenguaje.

PHP es un lenguaje y Node.js es un entorno para la ejecución de JavaScript mediante un servidor.

Collapse
 
hireindianprogrammers profile image
indumathysk

Thanks. Keep reading many more blogs here.

Collapse
 
ayomiku222 profile image
Ayomiku Olatunji John

Wow thanks for article. I recently left PHP after one month of using to nodejs due to many reason. Seeing your post makes me understand that both languages are good for backend. They both their advantages and disadvantages. I prefer nodejs.

Collapse
 
hireindianprogrammers profile image
indumathysk

Glad you like it.

Collapse
 
tanzimibthesam profile image
Tanzim Ibthesam

NodeJs is overkill for many apps n mostly syncs well with Nosql databases.PHP is evolving and has been in use in many small to.medium enterprise this is where PHP shines. Im terms of security PHP 7 is way better and Nodejs doesnt have nice franeworks most are unopinionated which means there is more possibility of writing poor code. Async await id make NodeJs shines but GO is slowly taking that place. PHP 8 has evolved with every version it keeps coming up with ground breaking features. Real time apps, web sockets for such Node might still be a safer choice for saas based apps n for quick prototype PHP specially Laravel is unbeatable. At the end of the day Softaware development is tough and every langauge has its pros and cons

Collapse
 
hireindianprogrammers profile image
indumathysk

Thank for sharing your point of view

Collapse
 
lexiebkm profile image
Alexander B.K.

If our app has to handle large concurrent (simultaneous) requests, but also has to be able to handle heavy calculations that involve complex SQL queries (including complex stored procedures) that consist of a lot of inner-outer joins, which one we should choose between the two ?
Because from what I read, Node.js is not adequate for performing heavy calculations, although it is good in handling numerous concurrent requests. Whereas, Apache (I am not sure with Nginx) capability is limited when it comes to large concurrent requests.
If none of these is suitable, then it means we should consider other alternatives like Java/J2EE or C# + ASP.net. I am not sure with Golang aka Go which is not mature enough.

Collapse
 
lexiebkm profile image
Alexander B.K.

I have just found the following old article by TJ Holowaychuk, the (main) creator of Koa.js (Node.js framework) who was also a former team member of Express :
medium.com/@tjholowaychuk/farewell...
What he said about Go aka Golang in comparison with Node.js makes me want to resume my learning of Go.

And I also remember what Ryan Dahl (the creator of Node) said about his creation which led him to create Deno. I am still waiting for wide acceptance of Deno, though, before getting started with this new creation by the same person.

Collapse
 
llbbl profile image
Logan Lindquist

Depends on the team and project. Comprehensive article!

Collapse
 
hireindianprogrammers profile image
indumathysk

Yes, Agree. Thank you for commenting