|
|
|
|
|
by mvalente
5846 days ago
|
|
When you use Apache/Nginx/etc, you're using a webserver. Usually you will also use a serverside programming language like Python, Ruby, PHP, etc. The webserver is usually programmed using C/C++ and the serverside language is "bolted" on. With Node.js you have Javascript as a serverside language (like PHP, Python, etc). But included with it you have a library that allows you to create a webserver. Instead of having a webserver and couple a serverside language to it, you have a serverside language that is able to spawn its own webserver (although you can choose to use Apache or others). The biggest advantage though, comes from the fact that JS is a functional language with a focus on event based programming. And so Node.js follows that paradigm: you use JS functions that are binded to certain events and run when one event happens, instead of running continously and doing some kind of loop waiting on I/O,CPU, database, etc. This allows for better performance. Plus there's the advantage of being able to program websites using the same language both client-side and serverside. But thats another matter. -- MV |
|