SlideShare une entreprise Scribd logo
1  sur  29
NodeJS Chapter-2
26 Dec 2020
Agenda
• Authentication and Authorization
• Worker Threads
• Web Sockets
• Streaming
• Cluster mode
• Database connection
2
Authentication
Authentication is the act of validating that users are whom they
claim to be. There are below ways to do authentication
• Username/Passwords
• Usernames and passwords are the most common authentication
factor. If a user enters the correct data, the system assumes the
identity is valid and grants access.
• One-time pins
• Grant access for only one session or transaction.
• Authentication apps
• Generate security codes via an outside party that grants access
• Biometrics
• A user presents a fingerprint or eye scan to gain access to the
system.
• We will discuss about Json Web Tokens for
authentication.
• JSON Web Tokens (JWT) have been introduced as
a method of communicating between two parties
securely.
• JWT is very popular for handling authentication
via HTTP.
• It keeps user identify within the token and transfer
token with http request.
Authentication
Authentication
Client Server
Client Server
Login Request
Signed JWT
Data request + Signed JWT
Response
Authentication
There are three section of JWT token as mentioned below,
• Header – First section is header, which is base 64
encoded string
• Data(Payload) – It contains JSON object send back to
User. It is recommended not to include any sensitive
data in JWTs, such as password.
• Signature of Token - This is generated by hashing the
string base64UrlEncode(header) + "." +
base64UrlEncode(Data) + secret using the algorithm
that is mentioned in the header section.
Authorization
• Authorization is a process the process of
grating/denying access to resource which allows the
user access various resources based on the user’s
identity.
• In Nodejs application, there could be different
functionalities/APIs those can be accessed by different
type of users depending on the role and
granting/denying access as per the role is the
authorization.
• There are different ways to implement authorization.
E.g. role based, oauth2., however we will discuss here
role based authorization.
8
• The worker_threads module enables the use of
threads that execute JavaScript in parallel.
• Workers (threads) are useful for performing CPU-
intensive JavaScript operations.
• worker_threads can share memory.
• They will not help much with I/O-intensive work.
Node.js’s built-in asynchronous I/O operations are
more efficient than Workers can be.
Worker Threads
Worker Threads
9
• worker_threads became available in Node.js 10.5.0
• Prior to Node.js 11.7.0, you could not access the
module unless you started node with the --
experimental-worker flag.
• isMainThread, parentPort, workerData,
resourceLimits, SHARE_ENV etc.. are the some of
the important setting for worker.
Worker Threads
10
WebSockets
• The WebSocket API is an advanced technology
that makes it possible to open a two-way interactive
communication session between the user's browser
and a server. With this API, you can send
messages to a server and receive event-driven
responses without having to poll the server for a
reply.
11
WebSockets in Nodejs
• Nodejs use ws npm module to support websockets
• ws is a simple to use, blazing fast, and thoroughly
tested WebSocket client and server
implementation.
12
WebSockets in Nodejs
13
Nodejs Applications of Websockets
• Chat apps
• Live location tracking on a map
• Live audience interaction
• Online auctions bid submission
• IoT device updates
14
What is Buffer
• Temporary storage for a chunk of data that is being
transferred from one place to another.
• The buffer is filled with data ,then passed along.
• Transfer small chunks of data at a time
15
Buffer
16
Stream is a collection of data – like an arrays, most
common difference is that , it might not available all at
once. Normally video or another large files do not fit to
memory. So backend application will read file as small
chunk for data and send it to bowser or another place.
17
Streams
18
Streams in Nodejs
• A stream is an abstract interface for working with
streaming data in Nodejs. The stream module
provides an API for implementing the stream
interface. It is core module of Nodejs so there is no
need to do npm install for this package.
19
Type of streams
1.Readable Streams
2.Writable Streams
3.Duplex Streams
4.Transform Streams
20
Readable Streams
21
• A readable stream, as the name suggests, allows
users to read data.
• They come in two variants or two different reading
modes, Paused and Flowing.
• There are different events like
data,end,error,readable,resume,pause
Another EventEmitter, writable streams, allow users to
write to a chosen destination.
22
Writable Streams
Transform Streams
It receives data from a input streams and manipulates
the data and transform the data .
23
Pipes and streams chaining
24
• Pipes are used to connect a streams to other.
Benefits of Streams
25
1. Time Efficiency
2. Spatial Efficiency
Cluster Module in Nodejs
• Cluster is group of node instances.
• There is one master node instances and other
worker instances.
• Take advantage of multi-core system
• Can communicate with the parent using IPC
26
Cluster Module in Nodejs
27
Connection with Database
• Connect with mysql
• Connect with psql
28
Questions?

Contenu connexe

Tendances

Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

Tendances (20)

Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS Limitations
 
Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
 
Containerless in the Cloud with AWS Lambda
Containerless in the Cloud with AWS LambdaContainerless in the Cloud with AWS Lambda
Containerless in the Cloud with AWS Lambda
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
 
Reactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOMReactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOM
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
 
Start with Angular framework
Start with Angular frameworkStart with Angular framework
Start with Angular framework
 
Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with Couchbase
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Cd with Github Travis CI and Heroku
Cd with Github Travis CI and HerokuCd with Github Travis CI and Heroku
Cd with Github Travis CI and Heroku
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
If Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsIf Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocs
 
Bash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or pythonBash-ing brittle indicators: Red teaming mac-os without bash or python
Bash-ing brittle indicators: Red teaming mac-os without bash or python
 

Similaire à Node js Chapter-2

KinomaJS on Microcontroller
KinomaJS on MicrocontrollerKinomaJS on Microcontroller
KinomaJS on Microcontroller
Ryuji Ishiguro
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
annalakshmi35
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 

Similaire à Node js Chapter-2 (20)

Basic API Creation with Node.JS
Basic API Creation with Node.JSBasic API Creation with Node.JS
Basic API Creation with Node.JS
 
Protecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropperProtecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropper
 
Protecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropperProtecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropper
 
Distributed Data Flow for the Web of Things: Distributed Node-RED
Distributed Data Flow for the Web of Things: Distributed Node-REDDistributed Data Flow for the Web of Things: Distributed Node-RED
Distributed Data Flow for the Web of Things: Distributed Node-RED
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1
 
KinomaJS on Microcontroller
KinomaJS on MicrocontrollerKinomaJS on Microcontroller
KinomaJS on Microcontroller
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
 
DECENTRALISED CHAT APPLICATION
DECENTRALISED CHAT APPLICATIONDECENTRALISED CHAT APPLICATION
DECENTRALISED CHAT APPLICATION
 
Application_layer.pdf
Application_layer.pdfApplication_layer.pdf
Application_layer.pdf
 
Finding and exploiting novel flaws in Java software (SyScan 2015)
Finding and exploiting novel flaws in Java software (SyScan 2015)Finding and exploiting novel flaws in Java software (SyScan 2015)
Finding and exploiting novel flaws in Java software (SyScan 2015)
 
Secure Data Sharing in Cloud Computing Using Revocable-Storage Identity-Based...
Secure Data Sharing in Cloud Computing Using Revocable-Storage Identity-Based...Secure Data Sharing in Cloud Computing Using Revocable-Storage Identity-Based...
Secure Data Sharing in Cloud Computing Using Revocable-Storage Identity-Based...
 
Online Examination System in .NET & DB2
Online Examination System in .NET & DB2Online Examination System in .NET & DB2
Online Examination System in .NET & DB2
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
 
Secure Developer Access at Decisiv
Secure Developer Access at DecisivSecure Developer Access at Decisiv
Secure Developer Access at Decisiv
 
Node js internal
Node js internalNode js internal
Node js internal
 
Yelpcamp: A review based website for campgrounds
Yelpcamp: A review based website for campgroundsYelpcamp: A review based website for campgrounds
Yelpcamp: A review based website for campgrounds
 
Proposal
ProposalProposal
Proposal
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
NodeJS
NodeJSNodeJS
NodeJS
 

Plus de Talentica Software

Android Media Player Development
Android Media Player DevelopmentAndroid Media Player Development
Android Media Player Development
Talentica Software
 

Plus de Talentica Software (19)

Typescript: Beginner to Advanced
Typescript: Beginner to AdvancedTypescript: Beginner to Advanced
Typescript: Beginner to Advanced
 
Web 3.0
Web 3.0Web 3.0
Web 3.0
 
Remix
RemixRemix
Remix
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
 
Node.js Chapter1
Node.js Chapter1Node.js Chapter1
Node.js Chapter1
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Setting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | TalenticaSetting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | Talentica
 
Connected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryConnected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discovery
 
Mobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging TrendsMobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging Trends
 
Android Media Player Development
Android Media Player DevelopmentAndroid Media Player Development
Android Media Player Development
 
Cross Platform Mobile Technologies
Cross Platform Mobile TechnologiesCross Platform Mobile Technologies
Cross Platform Mobile Technologies
 
Big Data Technologies - Hadoop
Big Data Technologies - HadoopBig Data Technologies - Hadoop
Big Data Technologies - Hadoop
 
Big Data – Are You Ready?
Big Data – Are You Ready?Big Data – Are You Ready?
Big Data – Are You Ready?
 
Legacy modernization
Legacy modernizationLegacy modernization
Legacy modernization
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case Study
 
Technology Challenges in Building New Media Applications
Technology Challenges in Building New Media ApplicationsTechnology Challenges in Building New Media Applications
Technology Challenges in Building New Media Applications
 
Flex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application DevelopmentFlex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application Development
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Node js Chapter-2

  • 2. Agenda • Authentication and Authorization • Worker Threads • Web Sockets • Streaming • Cluster mode • Database connection 2
  • 3. Authentication Authentication is the act of validating that users are whom they claim to be. There are below ways to do authentication • Username/Passwords • Usernames and passwords are the most common authentication factor. If a user enters the correct data, the system assumes the identity is valid and grants access. • One-time pins • Grant access for only one session or transaction. • Authentication apps • Generate security codes via an outside party that grants access • Biometrics • A user presents a fingerprint or eye scan to gain access to the system.
  • 4. • We will discuss about Json Web Tokens for authentication. • JSON Web Tokens (JWT) have been introduced as a method of communicating between two parties securely. • JWT is very popular for handling authentication via HTTP. • It keeps user identify within the token and transfer token with http request. Authentication
  • 5. Authentication Client Server Client Server Login Request Signed JWT Data request + Signed JWT Response
  • 6. Authentication There are three section of JWT token as mentioned below, • Header – First section is header, which is base 64 encoded string • Data(Payload) – It contains JSON object send back to User. It is recommended not to include any sensitive data in JWTs, such as password. • Signature of Token - This is generated by hashing the string base64UrlEncode(header) + "." + base64UrlEncode(Data) + secret using the algorithm that is mentioned in the header section.
  • 7. Authorization • Authorization is a process the process of grating/denying access to resource which allows the user access various resources based on the user’s identity. • In Nodejs application, there could be different functionalities/APIs those can be accessed by different type of users depending on the role and granting/denying access as per the role is the authorization. • There are different ways to implement authorization. E.g. role based, oauth2., however we will discuss here role based authorization.
  • 8. 8 • The worker_threads module enables the use of threads that execute JavaScript in parallel. • Workers (threads) are useful for performing CPU- intensive JavaScript operations. • worker_threads can share memory. • They will not help much with I/O-intensive work. Node.js’s built-in asynchronous I/O operations are more efficient than Workers can be. Worker Threads
  • 9. Worker Threads 9 • worker_threads became available in Node.js 10.5.0 • Prior to Node.js 11.7.0, you could not access the module unless you started node with the -- experimental-worker flag. • isMainThread, parentPort, workerData, resourceLimits, SHARE_ENV etc.. are the some of the important setting for worker.
  • 11. WebSockets • The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. 11
  • 12. WebSockets in Nodejs • Nodejs use ws npm module to support websockets • ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and server implementation. 12
  • 14. Nodejs Applications of Websockets • Chat apps • Live location tracking on a map • Live audience interaction • Online auctions bid submission • IoT device updates 14
  • 15. What is Buffer • Temporary storage for a chunk of data that is being transferred from one place to another. • The buffer is filled with data ,then passed along. • Transfer small chunks of data at a time 15
  • 17. Stream is a collection of data – like an arrays, most common difference is that , it might not available all at once. Normally video or another large files do not fit to memory. So backend application will read file as small chunk for data and send it to bowser or another place. 17 Streams
  • 18. 18
  • 19. Streams in Nodejs • A stream is an abstract interface for working with streaming data in Nodejs. The stream module provides an API for implementing the stream interface. It is core module of Nodejs so there is no need to do npm install for this package. 19
  • 20. Type of streams 1.Readable Streams 2.Writable Streams 3.Duplex Streams 4.Transform Streams 20
  • 21. Readable Streams 21 • A readable stream, as the name suggests, allows users to read data. • They come in two variants or two different reading modes, Paused and Flowing. • There are different events like data,end,error,readable,resume,pause
  • 22. Another EventEmitter, writable streams, allow users to write to a chosen destination. 22 Writable Streams
  • 23. Transform Streams It receives data from a input streams and manipulates the data and transform the data . 23
  • 24. Pipes and streams chaining 24 • Pipes are used to connect a streams to other.
  • 25. Benefits of Streams 25 1. Time Efficiency 2. Spatial Efficiency
  • 26. Cluster Module in Nodejs • Cluster is group of node instances. • There is one master node instances and other worker instances. • Take advantage of multi-core system • Can communicate with the parent using IPC 26
  • 27. Cluster Module in Nodejs 27
  • 28. Connection with Database • Connect with mysql • Connect with psql 28