O'Reilly logo

Node Security by Dominic Barnes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How Node.js differs?

What makes Node.js different from other platforms is in how it approaches I/O. It uses an event-loop in conjunction with asynchronous I/O, which allows it to achieve a high level of concurrency with a light footprint.

Typically, when a program needs some sort of external input, it does so in a synchronous fashion. The following line of code should be very familiar to any programmer:

var results = db.query("SELECT * FROM users");
print(results[0].username);

All we are doing here is querying a SQL database for a list of all users, and then we are printing out the first user's name. When querying a database like this, there are many intermediary steps that need to be taken, such as:

  1. Opening a connection to the database server.
  2. Transmitting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required