Ok, so what is Event-driven Programming?
Traditional web servers not built with a platform like Node.js are thread-based systems, which means you wait for a function to be called until it is 100% complete and loads in your browser. If you launch a traditional web server and it starts receiving connections, it will hold each connection open until it has performed the request to completion. Sometimes, this can take a few microseconds during which the server is blocking that I/O function. This can cause slow loading, and the only way to scale a thread-based system is to add more servers performing web application functions. Event-based systems on the other hand, are able to take your request and process it while simultaneously taking other requests. So you launch the event-driven web server, which starts receiving connections, and as it accepts the request, it moves to the next request immediately. When the original request is complete, the results are returned. This is also known as a “non-blocking I/O” as it is allowing another process to continue before completing the initial transmission. This system is highly scalable and you can add more servers performing web application functions but at a much lower rate than necessary with a thread-based system.
Why is Node.js becoming so popular?