Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Node.Js: Basics Concepts and Introduction

625 views

Published on

Node.Js: Basics Concepts and Introduction

Published in: Technology
  • Be the first to comment

Node.Js: Basics Concepts and Introduction

  1. 1. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. NODE.JS | Introduction & Basics Kanika Gera
  2. 2. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Agenda • Why Node.jS? • What is Node.js? • Architecture of Node.js • Evented I/O • Node.js Event Loop • Where to use Node JS • Demo
  3. 3. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Why Node.JS? 3 • Provide Easy Way to Build Scalable Network Programs
  4. 4. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. What is a Node.JS? 4 • Server Side JavaScript • Platform built on Chrome’s JavaScript runtime i.e. V8 script engine • Lightweight and Efficient • Event-Driven, works on the Non-Blocking Model • Can Handle Thousands of Concurrent Connections with Minimal Overhead on a Single Process.
  5. 5. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Run JavaScript on Server Side Allows to run Javascript code in the backend, outside a browser. Using Google’s V8 Engine Has Runtime environments and NPM library.
  6. 6. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. What is a Node.JS? 6
  7. 7. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Synchronous vs Asynchronous 7 Synchronous Asynchronous Waits for each operation to complete, after that executes next operation. Never waits each operation to complete, executes all at one time. Results handled as available. Step by Step execution Callbacks used to handle results
  8. 8. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Synchronous Example 8
  9. 9. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Asynchronous Example 9
  10. 10. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Single Thread, Synchronous I/O
  11. 11. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Multiple Thread, Synchronous I/O
  12. 12. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Single Thread, Asynchronous I/O
  13. 13. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Single Thread, Asynchronous I/O
  14. 14. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Event Loop
  15. 15. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Event Loop
  16. 16. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Non – Blocking I/O
  17. 17. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Non – Blocking I/O • Use Events • Never wait for I/O • I/O is expensive
  18. 18. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Where to Use Node.JS? 18 • Few CPU Cycles • I/O Operations • Chat/ messaging • Real – Time Applications • Communication Hubs • High Concurrency Applications
  19. 19. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Where You Cannot Use Node.JS? 19 • Heavy Computation • Large and Complicated Web Applications
  20. 20. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Getting Started 20 • http://nodejs.org • Download tar.gz • Extract to a directory • $ ./configure • $ make install
  21. 21. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. DEMO 21
  22. 22. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Who Uses Node.Js? 22
  23. 23. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. THANK YOU !

×