Nodejs
Nodejs is an open source cross platform java script run time
environment. This has the ability of executing java script code outside of a browser.
This is free to be run and has a lot of abilities in various platforms like
Windows, Linux, Macos and so on. There is how PHP and ASP handles file request
that sends task to computer’s file system. This waits until file system open
and read the file. This has the ability of returning the content to the
client. Then it is ready to handle the
next request. That is how Nodejs handles the file system. System is ready to
handle the next request when the file system has open and read.
Nodejs runs single threaded programming
which is memory efficient.
What can Nodejs do?
This basically generates dynamic page contents. This creates
open, read, write and delete from server. This can add, delete and modify our
data in the database. After we download and installed Nodejs, command line
interface of the computers can operate further applications.
Famous companies who use Nodejs.
- DowJones
- Ebay
- Yahoo
- Pearsons
There are some popular frameworks in Nodejs
Express
- Web application framework
Socket.io
- helps to make real time apps.
Jade
- This is based on template.
Mongoose
- MongoDb too has the ability of object modeling.
Reason for using Nodejs
Javascript is known for by working with java. This is so famouse and run in google V8 engine. This has the ability of using the language from
one end to other end. These are easily scaled both vertically and
horizontally. Performance increases after cashing memory. This even supports
unit testing.
Pros & Cons
The main benefit of using node is developers can use the
same language from one end to the other end. At the same time performance are
increased. This supports common tools like unit testing.
There are some disadvantages too. Ecosystem of Node.js is still immature. Lack
of having a process for managing errors too another con that developer come
across when using Node.js.
Event loop
Nodejs is single threaded. But it supports in callbacks and promises. Node uses observer patterns. The secret of light weight and fast of node js is the events. As soon as node starts the server, it initiates the variables. Then simply waits for event for occur. In event driven architecture there is a general loop that listen for events. Functions who listen for events are observers. Whenever event get fired, function starts executing.
Comments
Post a Comment