Is anyone here prefers Node over PHP for Backend?
For further actions, you may consider blocking this person and/or reporting abuse
Is anyone here prefers Node over PHP for Backend?
For further actions, you may consider blocking this person and/or reporting abuse
Latest comments (71)
PHP vs Node is not a valid comparison. PHP is a language whereas Node is a JS runtime. PHP seems little primitive to me. Node is more efficient for Asynchronous / Non Blocking systems. Node is basically a good VM lacking a good language.
Node is the best for BFF applications
PHP is the best for enterprise application with a lot of business logic
You should choose the platform for your current aims
You should choose NodeJS if:
In other cases (especially if you want your application to be secure and reliable) you should choose PHP
Long story short, the main differences are:
I am doing my project with Node already more than a year now. Cloud functions in Firebase and REST with Express. It got wild and chaotic. I can't get it organized. I can't even test it properly. While at work I am getting deeper with Symfony, which got all those Bundles, Interfaces, DI.
So I am hesitating now on how to proceed. I want to get most of logic out of cloud functions and do them as microservices. What I want to achieve is a good logging and some admin panel to be able to navigate quickly and flexible through the data. So far I understand that the best way to connect microservices is through some kind of queue and state machine. Firebase has a big limitation on filtering (which I need most for admin) and I am afraid I can't control the costs (it can get wild with more data), so I want to move all logic on own server and be able limit what and when to process. So far all triggers are on onWrite functions of Firestore documents. So it can get out of control real quick. I haven't found yet any alternative to Symfony in Node yet, that can allow me to do all the things. Neither I can migrate 100% to PHP, because there are some packages that only available in Node.
After a while working with Firebase it gets annoying, because you have to find workarounds to build your data model. Normalized thinking from MySQL you can forget right away. Neither NoSQL thinking works, because Firebase is not flexible enough with queries.
It's very painful and annoying. I already have an idea how to build it with API Platform in a way, but I want to give it a chance everything based on Node. Unfortunately I can't find good examples of something complex built on Node and it's like walking around and trying to find all the small pieces first and build a new thing. That always felt wrong in PHP world. There is always something working out there, some framework, some concept, some structure. In Node it feels like lots of small libraries which do the same thing and have releases faster than I deploy a new version of the app. And sometimes projects just get archived without any explanation of what happened.
I still have hopes that I have wrong perception and it's just takes time to learn and find a right thing.
I prefer PHP. As much as I use node (express, adonisJs etc) perhaps it could be because of my experience, I think until I have specific requirements that requires the strengths of node, I would choose Laravel everytime.
I love node no doubt, but I seem to have enjoyed alot or stability in my existing PHP backend systems.
In short it depends. Use node.js if you work with real-time socket io app, event based system or with multiple threads.
That might be simpler than trying to achieve something like that in php.
On another hand php let's you write really nice run and exit programs faster. Also with php it's really nice to work in oop and with variables, because you don't need to handle undefined, null and other similar problems. Also I like php arrays and JavaScript fuckery kind of sucks.
Overall I use php on large projects where I need stable and secure system.
Node.js is kind of new and still you can't trust it on Enterprise level.
If you read somewhere that php is insecure it's wrong. People who never worked in php and back end wrote it or they are just script kiddes who used old WordPress and got spam and viruses inserted. Tho we can all agree WordPress is trash. Why they still use plain php for templates? Lol.
The best answer so far! What do you think of Prisma or some Headless CMS, would you consider it as an alternative to API Platform?
The question should be the other way around.
Node has:
Now, what does PHP has to offer?
Node
You mean do I prefer a better language, in a more consistent platform, with the largest third party developer ecosystem software has ever seen?
Yes. Personally, I cannot stand PHP. Nearly every common complaint about JS applies to PHP and then some.
Python πππ
Want sink included? Django ππ
Want something lightweight? Flask π€
PHP should be relegated to legacy software from 2003. π©π©π©
Don't know enough about node to judge, but JavaScript is nice.
Python is cool... There are some interesting libraries for rust as well. I tend to favor node myself. I've never liked PHP, not to mention node/js jobs tend to pay better, especially if you're experienced with react.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.