News for hackers. Stuff that matters.
Re:Node.js and the new web front-end by k3n on Monday October 07, 2013 @01:10PM (#6509635)
Though there's no absolute answer here, and it could very well go either way, as he explains it would most likely be irrelevant due to the fact that PHP can only process serially.

For instance, if you need to run 3 SQL queries in PHP, then the total execution time will be t1 + t2 + t3. On the other hand, if you make those queries in NodeJS instead, it will be MAX(t1, t2, t3).

So, it depends on the complexity of your app and your ability to decouple and separate concerns in the NodeJS server.

Re:Node.js and the new web front-end by anonymoushn on Monday October 07, 2013 @02:22PM (#6510152)
Is it actually impossible to query the DB asynchronously in PHP?
Re:Node.js and the new web front-end by k3n on Monday October 07, 2013 @04:06PM (#6510840)
Not impossible, but not easy either considering PHP is single-threaded and synchronous.
Re:Node.js and the new web front-end by anonymoushn on Monday October 07, 2013 @05:00PM (#6511218)
I've never heard of languages being synchronous or asynchronous before. It looks like PHP ships with asynchronous DB APIs.
Re:Node.js and the new web front-end by k3n on Monday October 07, 2013 @09:34PM (#6512462)
Ok, poor example; just consider that it's single-threaded. Pretty much the only threading support is by way of a young PECL extension called pthreads[1], which is still experimental and dangerous. Otherwise, you can use the PCTL extension[2], if you don't mind compiling PHP yourself (and if you're not on Windows, where it's not supported).

1. http://www.php.net/manual/en/intro.pthreads.php

2. http://www.php.net/manual/en/pcntl.installation.php