My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://ashokbasnet.com.np
and update your bookmarks.

Showing posts with label Servers. Show all posts
Showing posts with label Servers. Show all posts

Thursday, February 23, 2012

Node.js : Introduction

150px-Nodejs_logo_lightNode.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Node.js was created by Ryan Dahl starting in 2009

Traditional Web Servers

The “traditional” mode of web servers has always been one of the thread-based model. You launch Apache or any other web server and it starts receiving connections. When it receives a connection, it holds that connection open until it has performed the request for the page or whatever other transaction was sent. If it make take a few microseconds to retrieve a page from disk or write results to a database, the web server is blocking on that input/output operation. (This is referred to as “blocking I/O“.) To scale this type of web server, you need to launch additional copies of the server (referred to as “thread-based” because each copy typically requires another operating system thread).