"Blocking code makes your server wait. Non-blocking code makes your server work while it waits."
Introduction
You've heard that Node.js is fast. But Node.js doesn't make your CPU faster or your database queries instant. What it does is eliminate something far more wasteful than slow code — idle waiting.
Most performance problems in web servers aren't caused by computation being too slow. They're caused by threads sitting frozen, doing absolutely nothing, while they wait for a file to load or a database to reply. Node.js is built from the ground up to never let that happen.
To understand how, you need to understand the difference between blocking and non-blocking code — and why that difference changes everything about how a server handles real-world load.






