SlideShare a Scribd company logo
9 anti-patterns 
for node.js teams 
Jeff Harrell 
@juxtajeff
Node first went live on paypal.com in 2013. 
Since: 
• 35 apps live (marketing, signup, 
account, payments, etc). 
• 400 new JavaScript engineers 
• 500,000 npm installs per day (internally) 
Made a good deal of mistakes to learn from
Anti-pattern #1 
Baggage from your previous technology
• "Node doesn't support x. It won’t work" 
• “How do I deal with npm version conflicts?” 
• “Can’t let the app restart. It takes too long”
Leave your baggage behind." 
! 
Except when you’re flying
Anti-pattern #2 
Monolithic applications
• Use an internal npm instance 
• Publish modules vs. embedding functionality 
• Don’t overload modules – compose them 
Prefer different user, credit card and bank modules 
Avoid a single “shared” module
Build with many blocks, not one."
Anti-pattern #3 
Googling “How to do x in JavaScript”
• jQuery results dominate search engines 
• Understand ES5 
• Be aware of what’s coming in ES6
Learn JavaScript before diving in." 
!
Anti-pattern #4 
Handling errors
• Use an Error object, not a string 
• Throwing is for programmer errors 
• Restart on uncaught exception vs ignoring it
Error cases are hard." 
! 
Make sure to deal with them
Anti-pattern #5 
Wrapping everything in promises
• Use for the right reasons (not throw or waterfall) 
• Modules should expose callback interfaces 
• Use promises sparingly in hot code 
27% of CPU time spent in promise execution
Callbacks." 
! 
Seriously
Anti-pattern #6 
Git URLs in your package.json
• Git URLs don’t fully leverage semver 
• Weird caching issues 
• Unstable state (akin to force overwriting in npm)
Publish to npm." 
! 
Set it up internally and use it
Anti-pattern #7 
Sloppy async code
• Understand control flow patterns 
• Don’t create crazy waterfalls 
Hoist functions 
Use promises (appropriately) 
Use async 
• Callback with code afterwards, but no return 
if (true) { 
callback(); 
} 
fallback();
Use good async patterns." 
! 
Queue funny mis-ordered async sentence
Anti-pattern #8 
Having node do everything
• SSL termination should be done by nginx 
• Heavy encryption is not for node 
• Don’t bind directly to port 80/443 
“How do I enable gzip?” 
“How do I add an SSL cert to my app?”
Best tool, meet job." 
!
Anti-pattern #9 
Ignoring the node ecosystem
• npm has a wealth of pre-written code 
• Get updates from community, e.g. Node Security 
• Conferences like this
Embrace your new community." 
! 
Warning: May contain drama
Thanks!" 
! 
Q&A is over drinks later!
Photo Credits 
1. https://www.flickr.com/photos/11334694@N00/268023465/ 
2. https://www.flickr.com/photos/14125773@N00/14205159881/ 
3. https://www.flickr.com/photos/60364452@N00/3921008904/ 
4. https://www.flickr.com/photos/83099438@N00/5902730038 
5. https://www.flickr.com/photos/82402200@N00/523497824/ 
6. https://www.flickr.com/photos/48553010@N00/113694992/ 
7. https://www.flickr.com/photos/46889122@N03/4304137088/ 
8. https://www.flickr.com/photos/39039882@N00/5189290606/ 
9. https://www.flickr.com/photos/43145783@N00/1852428153/

More Related Content

PDF
The Real World - Plugging the Enterprise Into It (nodejs)
PPTX
Unleash and Empower Your Engineers
PDF
Node.js Anti-Patterns and bad practices
PDF
Webconf nodejs-production-architecture
PDF
Understand How Node.js and Core Features Works
PPTX
Introduction to node.js by jiban
PDF
Horizontally Scaling Node.js and WebSockets
PPTX
Node.js debugging
The Real World - Plugging the Enterprise Into It (nodejs)
Unleash and Empower Your Engineers
Node.js Anti-Patterns and bad practices
Webconf nodejs-production-architecture
Understand How Node.js and Core Features Works
Introduction to node.js by jiban
Horizontally Scaling Node.js and WebSockets
Node.js debugging

What's hot (20)

PDF
Server-Side JavaScript with Nashorn
PDF
Introduction to Node.js
PDF
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
PDF
Zepto and the rise of the JavaScript Micro-Frameworks
PDF
React native in the wild @ Codemotion 2016 in Rome
PDF
Building web apps with node.js, socket.io, knockout.js and zombie.js - Codemo...
PDF
Complete MVC on NodeJS
PPTX
PHP Indonesia - Nodejs Web Development
PDF
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
KEY
OSCON 2011 - Node.js Tutorial
PPTX
Node js introduction
PDF
Queue Everything and Please Everyone
PPTX
Introduction to NodeJS
PPTX
Node js for enterprise
PDF
PDF
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
PPTX
Node js for beginners
PPTX
Saving Time By Testing With Jest
PPTX
Seattlerb why jruby
PPTX
Das kannste schon so machen
Server-Side JavaScript with Nashorn
Introduction to Node.js
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Zepto and the rise of the JavaScript Micro-Frameworks
React native in the wild @ Codemotion 2016 in Rome
Building web apps with node.js, socket.io, knockout.js and zombie.js - Codemo...
Complete MVC on NodeJS
PHP Indonesia - Nodejs Web Development
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
OSCON 2011 - Node.js Tutorial
Node js introduction
Queue Everything and Please Everyone
Introduction to NodeJS
Node js for enterprise
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Node js for beginners
Saving Time By Testing With Jest
Seattlerb why jruby
Das kannste schon so machen
Ad

Similar to 9 anti-patterns for node.js teams (20)

PDF
Node js Design Patterns Master best practices to build modular and scalable s...
PPTX
Node.js Getting Started &amd Best Practices
PDF
Instant Download Node js Design Patterns Master best practices to build modul...
PDF
Node.js security tour
PDF
8 tips for mastering node.js
PDF
8 tips for mastering node.js
PDF
Node.js Course 1 of 2 - Introduction and first steps
PDF
Learning Nodejs For Net Developers Harry Cummings
PDF
Perfomatix - NodeJS Coding Standards
PPTX
Nodejs web service for starters
PDF
Node.js Web Development.pdf
PPTX
Real World Lessons On The Anti-Patterns of Node.JS
PPTX
The Javascript Ecosystem
PDF
10 Job Interview Questions for Hiring NodeJS Developers
PPTX
Introduction to Node js
PDF
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
PPTX
How to Start Your Node.js Journey Step-by-Step Guide.pptx
PPTX
Node js meetup
PDF
Introduction to Node.js
PDF
ConFoo Presentation - Front-End Architecture
Node js Design Patterns Master best practices to build modular and scalable s...
Node.js Getting Started &amd Best Practices
Instant Download Node js Design Patterns Master best practices to build modul...
Node.js security tour
8 tips for mastering node.js
8 tips for mastering node.js
Node.js Course 1 of 2 - Introduction and first steps
Learning Nodejs For Net Developers Harry Cummings
Perfomatix - NodeJS Coding Standards
Nodejs web service for starters
Node.js Web Development.pdf
Real World Lessons On The Anti-Patterns of Node.JS
The Javascript Ecosystem
10 Job Interview Questions for Hiring NodeJS Developers
Introduction to Node js
React Js vs Node Js_ Which Framework to Choose for Your Next Web Application
How to Start Your Node.js Journey Step-by-Step Guide.pptx
Node js meetup
Introduction to Node.js
ConFoo Presentation - Front-End Architecture
Ad

Recently uploaded (20)

PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
history of c programming in notes for students .pptx
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Transform Your Business with a Software ERP System
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Cost to Outsource Software Development in 2025
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Monitoring Stack: Grafana, Loki & Promtail
Complete Guide to Website Development in Malaysia for SMEs
Oracle Fusion HCM Cloud Demo for Beginners
history of c programming in notes for students .pptx
Digital Systems & Binary Numbers (comprehensive )
Transform Your Business with a Software ERP System
Advanced SystemCare Ultimate Crack + Portable (2025)
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Design an Analysis of Algorithms I-SECS-1021-03
Cost to Outsource Software Development in 2025
Patient Appointment Booking in Odoo with online payment
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Designing Intelligence for the Shop Floor.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Odoo Companies in India – Driving Business Transformation.pdf
Download FL Studio Crack Latest version 2025 ?
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Monitoring Stack: Grafana, Loki & Promtail

9 anti-patterns for node.js teams

  • 1. 9 anti-patterns for node.js teams Jeff Harrell @juxtajeff
  • 2. Node first went live on paypal.com in 2013. Since: • 35 apps live (marketing, signup, account, payments, etc). • 400 new JavaScript engineers • 500,000 npm installs per day (internally) Made a good deal of mistakes to learn from
  • 3. Anti-pattern #1 Baggage from your previous technology
  • 4. • "Node doesn't support x. It won’t work" • “How do I deal with npm version conflicts?” • “Can’t let the app restart. It takes too long”
  • 5. Leave your baggage behind." ! Except when you’re flying
  • 7. • Use an internal npm instance • Publish modules vs. embedding functionality • Don’t overload modules – compose them Prefer different user, credit card and bank modules Avoid a single “shared” module
  • 8. Build with many blocks, not one."
  • 9. Anti-pattern #3 Googling “How to do x in JavaScript”
  • 10. • jQuery results dominate search engines • Understand ES5 • Be aware of what’s coming in ES6
  • 11. Learn JavaScript before diving in." !
  • 13. • Use an Error object, not a string • Throwing is for programmer errors • Restart on uncaught exception vs ignoring it
  • 14. Error cases are hard." ! Make sure to deal with them
  • 15. Anti-pattern #5 Wrapping everything in promises
  • 16. • Use for the right reasons (not throw or waterfall) • Modules should expose callback interfaces • Use promises sparingly in hot code 27% of CPU time spent in promise execution
  • 18. Anti-pattern #6 Git URLs in your package.json
  • 19. • Git URLs don’t fully leverage semver • Weird caching issues • Unstable state (akin to force overwriting in npm)
  • 20. Publish to npm." ! Set it up internally and use it
  • 22. • Understand control flow patterns • Don’t create crazy waterfalls Hoist functions Use promises (appropriately) Use async • Callback with code afterwards, but no return if (true) { callback(); } fallback();
  • 23. Use good async patterns." ! Queue funny mis-ordered async sentence
  • 24. Anti-pattern #8 Having node do everything
  • 25. • SSL termination should be done by nginx • Heavy encryption is not for node • Don’t bind directly to port 80/443 “How do I enable gzip?” “How do I add an SSL cert to my app?”
  • 26. Best tool, meet job." !
  • 27. Anti-pattern #9 Ignoring the node ecosystem
  • 28. • npm has a wealth of pre-written code • Get updates from community, e.g. Node Security • Conferences like this
  • 29. Embrace your new community." ! Warning: May contain drama
  • 30. Thanks!" ! Q&A is over drinks later!
  • 31. Photo Credits 1. https://www.flickr.com/photos/11334694@N00/268023465/ 2. https://www.flickr.com/photos/14125773@N00/14205159881/ 3. https://www.flickr.com/photos/60364452@N00/3921008904/ 4. https://www.flickr.com/photos/83099438@N00/5902730038 5. https://www.flickr.com/photos/82402200@N00/523497824/ 6. https://www.flickr.com/photos/48553010@N00/113694992/ 7. https://www.flickr.com/photos/46889122@N03/4304137088/ 8. https://www.flickr.com/photos/39039882@N00/5189290606/ 9. https://www.flickr.com/photos/43145783@N00/1852428153/