An introduction ...
Agenda
Agenda
● What is Node.js
Agenda
● What is Node.js
● How Node.js works
Agenda
● What is Node.js
● How Node.js works
● Some Node.js examples
Agenda
● What is Node.js
● How Node.js works
● Some Node.js examples
● How to learn Node.js
Agenda
● What is Node.js
● How Node.js works
● Some Node.js examples
● How to learn Node.js
● What Node.js is good at
What is Node.js
What is Node.js
Server-side JavaScript
What is Node.js
Server-side JavaScript
Node.js is a platform built on Chrome's
JavaScript runtime.
What is Node.js
Server-side JavaScript
Node.js is a platform built on Chrome's
JavaScript runtime.
Node.js uses an event-d...
Node.js and I/O
Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained
3
Node.js and I/O
Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained
3
5
Node.js and I/O
Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained
3
5
250
Node.js and I/O
Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained
3
5
250
41,000,000
Node.js and I/O
Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained
3
5
250
41,000,000
240,0...
Node.js Event Loop
Open File
Connect to Socket
Write to DB
Event Queue
Node.js Event Loop
Open File
Connect to Socket
Write to DB
Event Queue
Event Loop
Node.js Event Loop
Open File
Connect to Socket
Write to DB
Event Queue
File System
Network
Process
Other
Event Loop
Node.js Event Loop
Open File
Connect to Socket
Write to DB
Event Queue
File System
Network
Process
Other
Event Loop
Callba...
Node.js Example
1 var fs = require('fs');
2
3 fs.readFile(filename, function(err, data) {
4 var lines = data.toString().sp...
Node.js Stack
Node Standard Library
Node.js Stack
Node Standard Library
Node C++ Bindings
(http, socket, filesystem)
Node.js Stack
Node Standard Library
V8
threadpool
(libeio)
event loop
(libev)
crypto
(Open SSL)
dns
(c-ares)
Node C++ Bind...
Node.js Stack
Node Standard Library
Node C++ Bindings
(http, socket, filesystem)
V8
threadpool
(libeio)
event loop
(libev)...
Getting Started
● http://nodejs.org/
● Download tar.gz
● Extract to any directory
● $ ./configure
● $ make install
Demo
● The Node.js repl
● npm and a simple webserver
Great learning resources
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
nodeschool.io
Great learning resources
codewars.com
Great learning resources
Great learning resources
Great learning resources
nodejsdublin.com
Great learning resources
nodeup.com
What is Node.js good at?
Node.js is good at ...
Node.js
Webserver DB
Client #1
Client #2
Client #3
Chat Server
Node.js is good at ...
Node.js
Webserver DB
Client #1
Client #2
Client #3
Chat Server
Node.js is good at ...
Node.js
Webserver DB
Client #1
Client #2
Client #3
Chat Server
Node.js is good at ...
Node.js
Server
File System
Producer #1
Producer #2
Producer #3
Message Queuing System
Consumer #1
C...
Node.js is good at ...
Node.js
Server
File System
Producer #1
Producer #2
Producer #3
Message Queuing System
Consumer #1
C...
Node.js is good at ...
Node.js
Server
File System
Producer #1
Producer #2
Producer #3
Message Queuing System
Consumer #1
C...
Node.js is good at ...
Microservices
Microservices
● Small unit of functionality
Microservices
● Small unit of functionality
● About 100 lines long (can fit in your head)
Microservices
● Small unit of functionality
● About 100 lines long (can fit in your head)
● Independently deployed
Microservices
● Small unit of functionality
● About 100 lines long (can fit in your head)
● Independently deployed
● Loose...
Microservices
● Small unit of functionality
● About 100 lines long (can fit in your head)
● Independently deployed
● Loose...
Microservices
● Small unit of functionality
● About 100 lines long (can fit in your head)
● Independently deployed
● Loose...
Microservice Examples
● Store json object in MongoDB
Microservice Examples
● Store json object in MongoDB
● Calculate if it is time to scale app
Microservice Examples
● Store json object in MongoDB
● Calculate if it is time to scale app
● Receive user input and forwa...
Node.js is good at ...
Microservices
Web Browser
HDFS HBase MySQL
AuthorisationAuthentication
Web Layer
Component
Query HB...
Node.js is good at ...
Microservices
Web Browser
Authentication Authorisation
Web Layer
Component
Query HBaseExpire Old Da...
Node.js is good at ...
Microservices
Web Browser
Authentication
Authorisation
Web Layer
Component
Query HBaseExpire Old Da...
Worth watching
You Only Need 100 Lines of JavaScript Pragmatic Javascript
Notable Quotables
“We, among many others, find Node.js to be
an order of magnitude faster than other
tools for developing ...
Notable Quotables
“In real web production, in real large scale
systems, in real internet companies, node is
outperforming ...
More tech talks, please!
● Java 8 language features and the runtime
● Javascript technologies and language features
● Code...
Introduction to Node.js
Upcoming SlideShare
Loading in...5
×

Introduction to Node.js

1,887

Published on

Introduction to Node.js

Published in: Software, Technology

Introduction to Node.js

  1. 1. An introduction ...
  2. 2. Agenda
  3. 3. Agenda ● What is Node.js
  4. 4. Agenda ● What is Node.js ● How Node.js works
  5. 5. Agenda ● What is Node.js ● How Node.js works ● Some Node.js examples
  6. 6. Agenda ● What is Node.js ● How Node.js works ● Some Node.js examples ● How to learn Node.js
  7. 7. Agenda ● What is Node.js ● How Node.js works ● Some Node.js examples ● How to learn Node.js ● What Node.js is good at
  8. 8. What is Node.js
  9. 9. What is Node.js Server-side JavaScript
  10. 10. What is Node.js Server-side JavaScript Node.js is a platform built on Chrome's JavaScript runtime.
  11. 11. What is Node.js Server-side JavaScript Node.js is a platform built on Chrome's JavaScript runtime. Node.js uses an event-driven, non-blocking model to execute I/O intensive applications.
  12. 12. Node.js and I/O Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained 3
  13. 13. Node.js and I/O Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained 3 5
  14. 14. Node.js and I/O Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained 3 5 250
  15. 15. Node.js and I/O Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained 3 5 250 41,000,000
  16. 16. Node.js and I/O Source : https://www.altamiracorp.com/blog/employee-posts/nodejs-basics-explained 3 5 250 41,000,000 240,000,000
  17. 17. Node.js Event Loop Open File Connect to Socket Write to DB Event Queue
  18. 18. Node.js Event Loop Open File Connect to Socket Write to DB Event Queue Event Loop
  19. 19. Node.js Event Loop Open File Connect to Socket Write to DB Event Queue File System Network Process Other Event Loop
  20. 20. Node.js Event Loop Open File Connect to Socket Write to DB Event Queue File System Network Process Other Event Loop Callbacks (e.g. File Opened)
  21. 21. Node.js Example 1 var fs = require('fs'); 2 3 fs.readFile(filename, function(err, data) { 4 var lines = data.toString().split('n'); 5 console.log(lines.length); 6 });
  22. 22. Node.js Stack Node Standard Library
  23. 23. Node.js Stack Node Standard Library Node C++ Bindings (http, socket, filesystem)
  24. 24. Node.js Stack Node Standard Library V8 threadpool (libeio) event loop (libev) crypto (Open SSL) dns (c-ares) Node C++ Bindings (http, socket, filesystem)
  25. 25. Node.js Stack Node Standard Library Node C++ Bindings (http, socket, filesystem) V8 threadpool (libeio) event loop (libev) crypto (Open SSL) dns (c-ares)
  26. 26. Getting Started ● http://nodejs.org/ ● Download tar.gz ● Extract to any directory ● $ ./configure ● $ make install
  27. 27. Demo ● The Node.js repl ● npm and a simple webserver
  28. 28. Great learning resources
  29. 29. Great learning resources nodeschool.io
  30. 30. Great learning resources nodeschool.io
  31. 31. Great learning resources nodeschool.io
  32. 32. Great learning resources nodeschool.io
  33. 33. Great learning resources nodeschool.io
  34. 34. Great learning resources nodeschool.io
  35. 35. Great learning resources nodeschool.io
  36. 36. Great learning resources nodeschool.io
  37. 37. Great learning resources nodeschool.io
  38. 38. Great learning resources nodeschool.io
  39. 39. Great learning resources codewars.com
  40. 40. Great learning resources
  41. 41. Great learning resources
  42. 42. Great learning resources nodejsdublin.com
  43. 43. Great learning resources nodeup.com
  44. 44. What is Node.js good at?
  45. 45. Node.js is good at ... Node.js Webserver DB Client #1 Client #2 Client #3 Chat Server
  46. 46. Node.js is good at ... Node.js Webserver DB Client #1 Client #2 Client #3 Chat Server
  47. 47. Node.js is good at ... Node.js Webserver DB Client #1 Client #2 Client #3 Chat Server
  48. 48. Node.js is good at ... Node.js Server File System Producer #1 Producer #2 Producer #3 Message Queuing System Consumer #1 Consumer #2 Consumer #3
  49. 49. Node.js is good at ... Node.js Server File System Producer #1 Producer #2 Producer #3 Message Queuing System Consumer #1 Consumer #2 Consumer #3
  50. 50. Node.js is good at ... Node.js Server File System Producer #1 Producer #2 Producer #3 Message Queuing System Consumer #1 Consumer #2 Consumer #3
  51. 51. Node.js is good at ... Microservices
  52. 52. Microservices ● Small unit of functionality
  53. 53. Microservices ● Small unit of functionality ● About 100 lines long (can fit in your head)
  54. 54. Microservices ● Small unit of functionality ● About 100 lines long (can fit in your head) ● Independently deployed
  55. 55. Microservices ● Small unit of functionality ● About 100 lines long (can fit in your head) ● Independently deployed ● Loosely Coupled
  56. 56. Microservices ● Small unit of functionality ● About 100 lines long (can fit in your head) ● Independently deployed ● Loosely Coupled ● Codeable in a week
  57. 57. Microservices ● Small unit of functionality ● About 100 lines long (can fit in your head) ● Independently deployed ● Loosely Coupled ● Codeable in a week ● Owned by one developer
  58. 58. Microservice Examples ● Store json object in MongoDB
  59. 59. Microservice Examples ● Store json object in MongoDB ● Calculate if it is time to scale app
  60. 60. Microservice Examples ● Store json object in MongoDB ● Calculate if it is time to scale app ● Receive user input and forward request to another part of your app
  61. 61. Node.js is good at ... Microservices Web Browser HDFS HBase MySQL AuthorisationAuthentication Web Layer Component Query HBaseExpire Old Data Roll up Data
  62. 62. Node.js is good at ... Microservices Web Browser Authentication Authorisation Web Layer Component Query HBaseExpire Old Data Roll up Data Node.js Proxy
  63. 63. Node.js is good at ... Microservices Web Browser Authentication Authorisation Web Layer Component Query HBaseExpire Old Data Roll up Data Node.js Proxy
  64. 64. Worth watching You Only Need 100 Lines of JavaScript Pragmatic Javascript
  65. 65. Notable Quotables “We, among many others, find Node.js to be an order of magnitude faster than other tools for developing services.” http://www.feedhenry.com/transforming-enterprise-node-js-feedhenry/
  66. 66. Notable Quotables “In real web production, in real large scale systems, in real internet companies, node is outperforming the java stack in every case.” http://www.nearform.com/nodecrunch/release-the-kracken-how-paypal- is-being-revolutionized-by-node-js-and-lean-ux
  67. 67. More tech talks, please! ● Java 8 language features and the runtime ● Javascript technologies and language features ● Coder dojo ● Docker and LXC ● Build tools like Gradle and Grunt ● Working in real-life with Scala and Java ● Linux command line, environment tips and VI. ● The Linux OS in general (Kernal and system directories) ● Architecture “We want Volunteers, not Conscripts!”
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×