DEV Community

Discussion on: Node vs PHP

 
razbakov profile image
Aleksey Razbakov

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.