SlideShare a Scribd company logo
Node.js Learning Kit
Vipin Menon, Software Engineer, IBM
vipinmv1@in.ibm.com | @vipinmv | https://github.com/vipinmenon
Agenda
Introduction to Basic APIs and best practices.
Streams Buffers
Cluster Modules
Timers JSON
NPM Addons
stream - definition
Flowing data; perfect match for event architecture
stream – best practices
 Know your (data) producer, consumer and
backpressure
stream – best practices
 There are number of life cycle events for streams;
knowing and using those leads to efficient program
 Streams do not define data types, it flows your data as
is
buffer - definition
An abstraction around raw binary data
buffer - example
buffer – best practices
 Buffer is great for manipulating large in-memory data
 With `allocUnsafe()`, raw memory is exposed, so use it
with caution
 Buffer implies (large) memory, track your objects
cluster - definition
Share server load, exploit multiple cores
cluster - example
Master
Worker
cluster – best practices
 Use for single server multi-core exploitation; when load
grows beyond threshold, switch to horizontal scaling
 Don’t mix cluster with child_process – it adds complexity
 Session is not managed automatically, app needs to
implement one
modules - definition
Re-usable API abstractions
modules - example
modules – best practices
 Hide complexities under well defined APIs
 Avoid global state; avoid side effects (`process.exit`)
 Use discrete, disambiguating naming convention
timers - definition
Schedulers: Global APIs for future execution
timers - example
timers – best practices
 Don’t cover up program bugs with artificial delays
 `setInterval` is a recurring schedule, know when to shut
those down
 Don’t write code that critically rely on schedule precision
JSON - definition
 JavaScript Object Notation
 Data interchange format, native to JavaScript
 Specification for JS Object Marshalling / Unmarshalling
JSON - example
JSON – best practices
 Using a schema improves readability and speed
 Use shorter field names for serializable objects
 JSON processing is synchronous, so large (> 2 MB)
throttles the Node.js thread
NPM - definition
 Most popular JavaScript development tool registry
 Default Package manager for Node.js
npm - example
npm – best practices
 Known your modules! Audit and scan third party
modules periodically
 Use active and well maintained modules
 Lock your module dependencies
addons - definition
Foreign Function Interfacing; mainly C++
addons - example
addons – best practices
 Don’t directly deal with V8, use wrappers
 Addons run on main thread, don’t run tight loop code
 Many addon resources are not visible to Node.js so
use those under your control
Disclaimer
 The information contained in this presentation is provided for informational purposes only.
 While efforts were made to verify the completeness and accuracy of the information contained
in this presentation, it is provided “As Is”, without warranty of any kind, express or implied.
 In addition, this information is based on IBM’s current product plans and strategy, which are
subject to change by IBM without notice.
 IBM shall not be responsible for any damages arising out of the use of, or otherwise related to,
this presentation or any other documentation.
 Nothing contained in this presentation is intended to, or shall have the effect of:
 Creating any warranty or representation from IBM (or its affiliates or its or their supplies
and/or licensors); or
 Altering the terms and conditions of the applicable license agreement governing the use
of IBM software.
THANK YOU!

More Related Content

What's hot

How to speed up your website
How to speed up your websiteHow to speed up your website
How to speed up your website
VernalWeb
 
Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019
Pierre-Luc Maheu
 
Caching for Cash, part 4 DPC 2009
Caching for Cash, part 4 DPC 2009Caching for Cash, part 4 DPC 2009
Caching for Cash, part 4 DPC 2009
Helgi Þormar Þorbjörnsson
 
Frontend Caching - The "new" frontier
Frontend Caching - The "new" frontierFrontend Caching - The "new" frontier
Frontend Caching - The "new" frontier
Helgi Þormar Þorbjörnsson
 
Geek Sessions Talk
Geek Sessions TalkGeek Sessions Talk
Geek Sessions Talk
Jonathan Abrams
 
AWS Lambdas are cool - Cheminfo Stories Day 1
AWS Lambdas are cool - Cheminfo Stories Day 1AWS Lambdas are cool - Cheminfo Stories Day 1
AWS Lambdas are cool - Cheminfo Stories Day 1
ChemAxon
 
High Availabiltity & Replica Sets with mongoDB
High Availabiltity & Replica Sets with mongoDBHigh Availabiltity & Replica Sets with mongoDB
High Availabiltity & Replica Sets with mongoDB
Gareth Davies
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
codearachnid_test
 
dh-slides-perf.ppt
dh-slides-perf.pptdh-slides-perf.ppt
dh-slides-perf.ppt
hackday08
 
Let the Tiger Roar!
Let the Tiger Roar!Let the Tiger Roar!
Let the Tiger Roar!
MongoDB
 
Managing and Scaling Puppet - PuppetConf 2014
Managing and Scaling Puppet - PuppetConf 2014Managing and Scaling Puppet - PuppetConf 2014
Managing and Scaling Puppet - PuppetConf 2014
Puppet
 
Redis part 2
Redis part 2Redis part 2
Redis part 2
George Li
 

What's hot (12)

How to speed up your website
How to speed up your websiteHow to speed up your website
How to speed up your website
 
Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019
 
Caching for Cash, part 4 DPC 2009
Caching for Cash, part 4 DPC 2009Caching for Cash, part 4 DPC 2009
Caching for Cash, part 4 DPC 2009
 
Frontend Caching - The "new" frontier
Frontend Caching - The "new" frontierFrontend Caching - The "new" frontier
Frontend Caching - The "new" frontier
 
Geek Sessions Talk
Geek Sessions TalkGeek Sessions Talk
Geek Sessions Talk
 
AWS Lambdas are cool - Cheminfo Stories Day 1
AWS Lambdas are cool - Cheminfo Stories Day 1AWS Lambdas are cool - Cheminfo Stories Day 1
AWS Lambdas are cool - Cheminfo Stories Day 1
 
High Availabiltity & Replica Sets with mongoDB
High Availabiltity & Replica Sets with mongoDBHigh Availabiltity & Replica Sets with mongoDB
High Availabiltity & Replica Sets with mongoDB
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
dh-slides-perf.ppt
dh-slides-perf.pptdh-slides-perf.ppt
dh-slides-perf.ppt
 
Let the Tiger Roar!
Let the Tiger Roar!Let the Tiger Roar!
Let the Tiger Roar!
 
Managing and Scaling Puppet - PuppetConf 2014
Managing and Scaling Puppet - PuppetConf 2014Managing and Scaling Puppet - PuppetConf 2014
Managing and Scaling Puppet - PuppetConf 2014
 
Redis part 2
Redis part 2Redis part 2
Redis part 2
 

Similar to Essentials nodejs learning kit

Node js meetup
Node js meetupNode js meetup
Node js meetup
Ansuman Roy
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)
John Pape
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
IndicThreads
 
Node.js security tour
Node.js security tourNode.js security tour
Node.js security tour
Giacomo De Liberali
 
MongoDB at MapMyFitness
MongoDB at MapMyFitnessMongoDB at MapMyFitness
MongoDB at MapMyFitness
MapMyFitness
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
Mark Proctor
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
Expeed Software
 
[AWS Dev Day] 인공지능 / 기계 학습 | AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
[AWS Dev Day] 인공지능 / 기계 학습 |  AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...[AWS Dev Day] 인공지능 / 기계 학습 |  AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
[AWS Dev Day] 인공지능 / 기계 학습 | AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
Amazon Web Services Korea
 
Performance on a budget
Performance on a budgetPerformance on a budget
Performance on a budget
Dimitry Ushakov
 
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
Amazon Web Services
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
Jason Ragsdale
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
webuploader
 
Perfomatix - NodeJS Coding Standards
Perfomatix - NodeJS Coding StandardsPerfomatix - NodeJS Coding Standards
Perfomatix - NodeJS Coding Standards
Perfomatix Solutions
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
Steve Feldman
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web Application
Yue Tian
 
journal for research
journal for researchjournal for research
journal for research
chaitanya451336
 
Scaling Web Apps P Falcone
Scaling Web Apps P FalconeScaling Web Apps P Falcone
Scaling Web Apps P Falcone
jedt
 
Usemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual MachinveUsemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual Machinve
Paul René Jørgensen
 
Java on Rails SV Code Camp 2014
Java on Rails SV Code Camp 2014Java on Rails SV Code Camp 2014
Java on Rails SV Code Camp 2014
Tim Hobson
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
Khaled Mosharraf
 

Similar to Essentials nodejs learning kit (20)

Node js meetup
Node js meetupNode js meetup
Node js meetup
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)
 
Optimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardwareOptimizing your java applications for multi core hardware
Optimizing your java applications for multi core hardware
 
Node.js security tour
Node.js security tourNode.js security tour
Node.js security tour
 
MongoDB at MapMyFitness
MongoDB at MapMyFitnessMongoDB at MapMyFitness
MongoDB at MapMyFitness
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 
[AWS Dev Day] 인공지능 / 기계 학습 | AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
[AWS Dev Day] 인공지능 / 기계 학습 |  AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...[AWS Dev Day] 인공지능 / 기계 학습 |  AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
[AWS Dev Day] 인공지능 / 기계 학습 | AWS 기반 기계 학습 자동화 및 최적화를 위한 실전 기법 - 남궁영환 AWS 솔루션...
 
Performance on a budget
Performance on a budgetPerformance on a budget
Performance on a budget
 
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
How Netflix Tunes Amazon EC2 Instances for Performance - CMP325 - re:Invent 2017
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
Perfomatix - NodeJS Coding Standards
Perfomatix - NodeJS Coding StandardsPerfomatix - NodeJS Coding Standards
Perfomatix - NodeJS Coding Standards
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web Application
 
journal for research
journal for researchjournal for research
journal for research
 
Scaling Web Apps P Falcone
Scaling Web Apps P FalconeScaling Web Apps P Falcone
Scaling Web Apps P Falcone
 
Usemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual MachinveUsemon; Building The Big Brother Of The Java Virtual Machinve
Usemon; Building The Big Brother Of The Java Virtual Machinve
 
Java on Rails SV Code Camp 2014
Java on Rails SV Code Camp 2014Java on Rails SV Code Camp 2014
Java on Rails SV Code Camp 2014
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 

Recently uploaded

WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 

Recently uploaded (20)

WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 

Essentials nodejs learning kit

  • 1. Node.js Learning Kit Vipin Menon, Software Engineer, IBM vipinmv1@in.ibm.com | @vipinmv | https://github.com/vipinmenon
  • 2. Agenda Introduction to Basic APIs and best practices. Streams Buffers Cluster Modules Timers JSON NPM Addons
  • 3. stream - definition Flowing data; perfect match for event architecture
  • 4. stream – best practices  Know your (data) producer, consumer and backpressure
  • 5. stream – best practices  There are number of life cycle events for streams; knowing and using those leads to efficient program  Streams do not define data types, it flows your data as is
  • 6. buffer - definition An abstraction around raw binary data
  • 8. buffer – best practices  Buffer is great for manipulating large in-memory data  With `allocUnsafe()`, raw memory is exposed, so use it with caution  Buffer implies (large) memory, track your objects
  • 9. cluster - definition Share server load, exploit multiple cores
  • 11. cluster – best practices  Use for single server multi-core exploitation; when load grows beyond threshold, switch to horizontal scaling  Don’t mix cluster with child_process – it adds complexity  Session is not managed automatically, app needs to implement one
  • 12. modules - definition Re-usable API abstractions
  • 14. modules – best practices  Hide complexities under well defined APIs  Avoid global state; avoid side effects (`process.exit`)  Use discrete, disambiguating naming convention
  • 15. timers - definition Schedulers: Global APIs for future execution
  • 17. timers – best practices  Don’t cover up program bugs with artificial delays  `setInterval` is a recurring schedule, know when to shut those down  Don’t write code that critically rely on schedule precision
  • 18. JSON - definition  JavaScript Object Notation  Data interchange format, native to JavaScript  Specification for JS Object Marshalling / Unmarshalling
  • 20. JSON – best practices  Using a schema improves readability and speed  Use shorter field names for serializable objects  JSON processing is synchronous, so large (> 2 MB) throttles the Node.js thread
  • 21. NPM - definition  Most popular JavaScript development tool registry  Default Package manager for Node.js
  • 23. npm – best practices  Known your modules! Audit and scan third party modules periodically  Use active and well maintained modules  Lock your module dependencies
  • 24. addons - definition Foreign Function Interfacing; mainly C++
  • 26. addons – best practices  Don’t directly deal with V8, use wrappers  Addons run on main thread, don’t run tight loop code  Many addon resources are not visible to Node.js so use those under your control
  • 27. Disclaimer  The information contained in this presentation is provided for informational purposes only.  While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided “As Is”, without warranty of any kind, express or implied.  In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice.  IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other documentation.  Nothing contained in this presentation is intended to, or shall have the effect of:  Creating any warranty or representation from IBM (or its affiliates or its or their supplies and/or licensors); or  Altering the terms and conditions of the applicable license agreement governing the use of IBM software.