Is the node a good choice for database driven websites? I understand the performance advantage in real-time scenarios and applications. But does it offer the same performance advantage for classic, database driven CMS websites, compared to nginx + php-fpm.

this isn't the place for such a question. try to test both platforms and see what works best for you
–
Vlad BalmosSep 28 '12 at 11:58

I tried using both Node.js and Nginx + PHP-FPM for a project I'm working on. Node was a high learning curve for me as I'm really used to PHP. I find that Nginx + PHP-FPM is soo fast, that really, at this point, it becomes more which language you're more confortable with.
–
jValdronSep 28 '12 at 12:26

@jValdron: I kinda feel the same. I played around with with node, but I still don't know it enough to write anything comparable to what I have in PHP, so I can't really do any realistic testing. I apologize if this is not a place for such questions. I didn't know where else to find serious programmers who tried both PHP and node in real life projects. Thanks for sharing your experience.
–
ssamSep 28 '12 at 13:19

@ssam i think you got your answer. if you don't feel confident enough to write solid apps using node then stick with what you know best. everything can scale in the end, be it apache + php or nginx + php or node, as long as you have a good solid designed app.
–
Vlad BalmosSep 28 '12 at 16:52

@ssam and remeber to use the right tool for the job, node is as good with database driven websites as the other guy, but works best for realtime application and promotes code reuses between server and client
–
Vlad BalmosSep 28 '12 at 16:55

1 Answer
1

Node is good choice for database driven websites given that you have database binding written in non-blocking way. Most used database servers now have nodejs bindings written in non-blocking way.

For example, PHP with apache. It creates a thread per request. When doing IO with database thread is in blocking state. It means http server can't do anything with that request till IO completes, 40,000,000 cycles. This is wrong way of doing IO. While in nodeJS, if db binding is written in non-blocking way, binding is doing IO in thread pool and node event loop is listening for events.