node.jsJames Singh
Node.js is a software platform for scalable server-side and
networking applications. Node.js applications are written in
J...
I/O needs to be done differently.
Many web applications have code
like this:
var result =
db.query("select * from T");
// use result
What is the software do...
In many cases, just waiting for the
response.
I/O latency
L1: 3 cycles
L2: 14 cycles
RAM: 250 cycles
DISK: 41,000,000 cycles
NETWORK: 240,000,000 cycles
Better software can multitask.
Other threads of execution can run
while waiting.
Apache vs NGINX
Apache vs NGINX
Apache vs NGINX
The difference?
Apache uses one thread per
Connection.
NGINX doesn’t use threads. It uses
an event loop.
Code like this
var result = db.query("select..");
// use result
either blocks the entire process or
implies multiple execu...
But a line of code like this
db.query("select..", function (result) {
// use result
});
allows the program to return to th...
So why isn’t everyone using event
loops, callbacks, and non-blocking
I/O?
For reasons both cultural and
infrastructural.
What can you make with it?
Who is using it?
Is it easy to use?
What client libraries are
available?
Memcached, Redis, MySQL, MongoDB, Solr, RabbitMQ
MEAN framework
How to install?
http://nodejs.org
Questions?
Upcoming SlideShare
Loading in …5
×

node.js

732 views

Published on

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
732
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

node.js

  1. 1. node.jsJames Singh
  2. 2. Node.js is a software platform for scalable server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on Windows, Mac OS X and Linux with no changes. Node.js applications are designed to maximize throughput and efficiency, using non-blocking I/O and asynchronous events. Node.js applications run single-threaded, although Node uses multiple threads for file and network events. Node.js internally uses the Google V8 JavaScript engine to execute code, and a large percentage of the basic modules are written in JavaScript. Node.js contains a built-in HTTP server library, making it possible to run a web server without Apache or Lighttpd. -Wikipedia
  3. 3. I/O needs to be done differently.
  4. 4. Many web applications have code like this: var result = db.query("select * from T"); // use result What is the software doing while it queries the database?
  5. 5. In many cases, just waiting for the response.
  6. 6. I/O latency L1: 3 cycles L2: 14 cycles RAM: 250 cycles DISK: 41,000,000 cycles NETWORK: 240,000,000 cycles
  7. 7. Better software can multitask. Other threads of execution can run while waiting.
  8. 8. Apache vs NGINX
  9. 9. Apache vs NGINX
  10. 10. Apache vs NGINX The difference? Apache uses one thread per Connection. NGINX doesn’t use threads. It uses an event loop.
  11. 11. Code like this var result = db.query("select.."); // use result either blocks the entire process or implies multiple execution stacks.
  12. 12. But a line of code like this db.query("select..", function (result) { // use result }); allows the program to return to the event loop immediately.
  13. 13. So why isn’t everyone using event loops, callbacks, and non-blocking I/O? For reasons both cultural and infrastructural.
  14. 14. What can you make with it?
  15. 15. Who is using it?
  16. 16. Is it easy to use?
  17. 17. What client libraries are available? Memcached, Redis, MySQL, MongoDB, Solr, RabbitMQ
  18. 18. MEAN framework
  19. 19. How to install? http://nodejs.org
  20. 20. Questions?

×