SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
INTOTHE WILD WITH
NODE.JS AND WEB APPS
Node.jsTalk at Klout, 2012
Chris Bumgardner
Friday, April 20, 12
ME
• Co-founder and Chief-Programmer of AskYourUsers.com
• @chrisbumgardner and cbumgard@gmail.com
• github.com/cbumgard
• My first ‘real’ production web app in Node.js
• Invite only beta, going live this week.
Friday, April 20, 12
THE STACK
• Node.js
• Express
• MongoDB
• Redis
• Apache Solr
• Nginx / Ubuntu 11 / 2 x LinodeVPS
Friday, April 20, 12
CONFIGURATION
• Partition your configuration by environment.
• E.g. Config[process.env.NODE_ENV]
• We have 3 environments: 2 dev and 1 production.
• Environment is top-level namespace (‘dev’,‘production’, etc)
for everything, including db. Keeps worlds from colliding.
• Makes life easy
Friday, April 20, 12
CONFIGURATION 2
• dev env 1: sessions in memory, clean db each start.
• dev env 2: persistent sessions & db, ssl.
• production env: aggressive caching, ssl, live payments, clustered,
fancier logging (more later), email/sms notifications.
Friday, April 20, 12
LOGGING
• Log early and often.
• Using Winston with the MongoDB transport.
• MongoDB logging: fast writes; pass json objs in log msgs; easy
ad-hoc queries; easy lru via capped collections.
• Client logging from browser: caught and logged to Google
Analytics as custom event. Easy monitoring/aggregation.
Friday, April 20, 12
DEPLOYMENT
• Custom CI system in node that responds pushes to github
• Post-Receive service hook. Github POSTs to us after a push.
• CI will pull code if it’s the right branch (say ‘staging’), restart,
and send SMS.
• Easy and low touch.Texts from your node are nice.
• Refactoring into a more modular/decoupled hook.io system.
Friday, April 20, 12
ALSO
• In development: use ‘nodemon’ to start server.
• Watches all files in project and restarts node if anything
changes.
• Great with persistent sessions, test changes immediately.
• In production: use ‘forever’ to start server as daemon. Restarts
node automatically if it crashes. Runs in background. Nice CLI.
Manages stdout/stderr logs.Tracks multiple processes.
Friday, April 20, 12
CLUSTERING
• In production, use ‘cluster’ module to fork separate node per
core
• App-wide initialization: if cluster.isMaster
• Otherwise per-proc initialization
Friday, April 20, 12
DEPENDENCIES
• Found out the hard way to control node, npm, and dependent
module versions.You don’t want to push a change to
production and have npm barf. No bueno.
• Keep them the same on all machines.
• Use npm in development.
• In production I recommend bundling/controlling the deps and
versions explicitly.
Friday, April 20, 12
PROFILING
• ‘ab’ is your friend.
• don’t forget ulimit.
• Joyent has great video on profiling with dtrace.
• ‘nodetime’ module: great in development, but my server got
hosed when I tried it in production. Probably user error.
Friday, April 20, 12
THANKS!
(you can email me at cbumgard@gmail.com)
Beyond the Closed Beta, Node.js from code to
production (at scale)
Node.js ++ (Serverside Javascripters) Club SF
Friday, April 20, 12

Contenu connexe

Tendances

Virtual Machine LAMP on Windows
Virtual Machine LAMP on WindowsVirtual Machine LAMP on Windows
Virtual Machine LAMP on Windowsmikehie
 
Apache Mesos Distributed Computing Talk
Apache Mesos Distributed Computing Talk Apache Mesos Distributed Computing Talk
Apache Mesos Distributed Computing Talk brandongulla
 
Puppet - Instant Data Center
Puppet  - Instant Data CenterPuppet  - Instant Data Center
Puppet - Instant Data CenterBryan Belanger
 
Ansible
AnsibleAnsible
Ansiblegnosek
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 
Herramientas front
Herramientas frontHerramientas front
Herramientas frontborya09
 
Building a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDBBuilding a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDBVivochaLabs
 
Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10David Ashton
 
Introduction to node
Introduction to nodeIntroduction to node
Introduction to nodegirish82
 
Vagrant: Your Personal Cloud
Vagrant: Your Personal CloudVagrant: Your Personal Cloud
Vagrant: Your Personal CloudJames Wickett
 
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)Ricardo Castelhano
 
Müssen es denn immer gleich Docker und Kubernetes sein?!
Müssen es denn immer gleich Docker und Kubernetes sein?!Müssen es denn immer gleich Docker und Kubernetes sein?!
Müssen es denn immer gleich Docker und Kubernetes sein?!inovex GmbH
 
Nightwatch.js (vodQA Shots - Pune 2017)
Nightwatch.js (vodQA Shots - Pune 2017)Nightwatch.js (vodQA Shots - Pune 2017)
Nightwatch.js (vodQA Shots - Pune 2017)Smriti Tuteja
 
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletion
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletionVMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletion
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletionBen Smogolski
 

Tendances (20)

Virtual Machine LAMP on Windows
Virtual Machine LAMP on WindowsVirtual Machine LAMP on Windows
Virtual Machine LAMP on Windows
 
Apache Mesos Distributed Computing Talk
Apache Mesos Distributed Computing Talk Apache Mesos Distributed Computing Talk
Apache Mesos Distributed Computing Talk
 
Puppet - Instant Data Center
Puppet  - Instant Data CenterPuppet  - Instant Data Center
Puppet - Instant Data Center
 
Ansible
AnsibleAnsible
Ansible
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
Node
NodeNode
Node
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Herramientas front
Herramientas frontHerramientas front
Herramientas front
 
Building a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDBBuilding a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDB
 
Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10
 
Introduction to node
Introduction to nodeIntroduction to node
Introduction to node
 
Vagrant: Your Personal Cloud
Vagrant: Your Personal CloudVagrant: Your Personal Cloud
Vagrant: Your Personal Cloud
 
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
 
Nodejs
NodejsNodejs
Nodejs
 
Müssen es denn immer gleich Docker und Kubernetes sein?!
Müssen es denn immer gleich Docker und Kubernetes sein?!Müssen es denn immer gleich Docker und Kubernetes sein?!
Müssen es denn immer gleich Docker und Kubernetes sein?!
 
Nightwatch.js (vodQA Shots - Pune 2017)
Nightwatch.js (vodQA Shots - Pune 2017)Nightwatch.js (vodQA Shots - Pune 2017)
Nightwatch.js (vodQA Shots - Pune 2017)
 
Docker
DockerDocker
Docker
 
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletion
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletionVMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletion
VMwarevSphere_ConfigureAdvancedHighAvailabilityFeatures_CertificateOfCompletion
 
Version Controlling
Version ControllingVersion Controlling
Version Controlling
 

En vedette

Top 10 finais de séries mais emocionantes
Top 10 finais de séries mais emocionantesTop 10 finais de séries mais emocionantes
Top 10 finais de séries mais emocionantesFábio Lins
 
""Into the Wild" ... with Natural Language Processing and Text Classification...
""Into the Wild" ... with Natural Language Processing and Text Classification...""Into the Wild" ... with Natural Language Processing and Text Classification...
""Into the Wild" ... with Natural Language Processing and Text Classification...Dataconomy Media
 
Doppelganger Breaking Bad
Doppelganger Breaking BadDoppelganger Breaking Bad
Doppelganger Breaking BadAndrea Dale
 
Into the wild
Into the wildInto the wild
Into the wildamccaff
 
Jornada do Herói em Breaking Bad
Jornada do Herói em Breaking BadJornada do Herói em Breaking Bad
Jornada do Herói em Breaking BadMateus Oazem
 
Breaking bad powerpoint aleix mando
Breaking bad powerpoint aleix mandoBreaking bad powerpoint aleix mando
Breaking bad powerpoint aleix mandoMari Carmen Moreno
 
Breaking Bad: Todos los personajes Parte 1
Breaking Bad: Todos los personajes Parte 1Breaking Bad: Todos los personajes Parte 1
Breaking Bad: Todos los personajes Parte 1alberts1999
 
Into the Wild: A Critical Analysis
Into the Wild: A Critical AnalysisInto the Wild: A Critical Analysis
Into the Wild: A Critical Analysiskeithchrisman
 
Diary of Chris McCandless
Diary of Chris McCandlessDiary of Chris McCandless
Diary of Chris McCandlessalvinchen977
 
Presentation on Breaking
Presentation on BreakingPresentation on Breaking
Presentation on BreakingUsoa Sol
 
Breaking bad news in obstetrics
Breaking bad news in obstetricsBreaking bad news in obstetrics
Breaking bad news in obstetricsDibu Sam
 
Breaking bad powerpoint
Breaking bad powerpointBreaking bad powerpoint
Breaking bad powerpointCmcaprietta
 
The Heisenberg Principles: 5 Business Lessons from Breaking Bad
The Heisenberg Principles: 5 Business Lessons from Breaking BadThe Heisenberg Principles: 5 Business Lessons from Breaking Bad
The Heisenberg Principles: 5 Business Lessons from Breaking BadJustin Oh
 
Teoria das cores e Breaking Bad
Teoria das cores e Breaking BadTeoria das cores e Breaking Bad
Teoria das cores e Breaking BadWilson Souza
 
Breaking bad news ----
Breaking bad news ----Breaking bad news ----
Breaking bad news ----Pk Doctors
 

En vedette (19)

Top 10 finais de séries mais emocionantes
Top 10 finais de séries mais emocionantesTop 10 finais de séries mais emocionantes
Top 10 finais de séries mais emocionantes
 
Into the wild
Into the wildInto the wild
Into the wild
 
""Into the Wild" ... with Natural Language Processing and Text Classification...
""Into the Wild" ... with Natural Language Processing and Text Classification...""Into the Wild" ... with Natural Language Processing and Text Classification...
""Into the Wild" ... with Natural Language Processing and Text Classification...
 
Doppelganger Breaking Bad
Doppelganger Breaking BadDoppelganger Breaking Bad
Doppelganger Breaking Bad
 
Into the wild
Into the wildInto the wild
Into the wild
 
Jornada do Herói em Breaking Bad
Jornada do Herói em Breaking BadJornada do Herói em Breaking Bad
Jornada do Herói em Breaking Bad
 
Into the Wild
Into the WildInto the Wild
Into the Wild
 
Breaking bad powerpoint aleix mando
Breaking bad powerpoint aleix mandoBreaking bad powerpoint aleix mando
Breaking bad powerpoint aleix mando
 
Breaking Bad: Todos los personajes Parte 1
Breaking Bad: Todos los personajes Parte 1Breaking Bad: Todos los personajes Parte 1
Breaking Bad: Todos los personajes Parte 1
 
Into the Wild: A Critical Analysis
Into the Wild: A Critical AnalysisInto the Wild: A Critical Analysis
Into the Wild: A Critical Analysis
 
Diary of Chris McCandless
Diary of Chris McCandlessDiary of Chris McCandless
Diary of Chris McCandless
 
Presentation on Breaking
Presentation on BreakingPresentation on Breaking
Presentation on Breaking
 
Breaking bad news in obstetrics
Breaking bad news in obstetricsBreaking bad news in obstetrics
Breaking bad news in obstetrics
 
Breaking bad
Breaking badBreaking bad
Breaking bad
 
Breaking bad
Breaking badBreaking bad
Breaking bad
 
Breaking bad powerpoint
Breaking bad powerpointBreaking bad powerpoint
Breaking bad powerpoint
 
The Heisenberg Principles: 5 Business Lessons from Breaking Bad
The Heisenberg Principles: 5 Business Lessons from Breaking BadThe Heisenberg Principles: 5 Business Lessons from Breaking Bad
The Heisenberg Principles: 5 Business Lessons from Breaking Bad
 
Teoria das cores e Breaking Bad
Teoria das cores e Breaking BadTeoria das cores e Breaking Bad
Teoria das cores e Breaking Bad
 
Breaking bad news ----
Breaking bad news ----Breaking bad news ----
Breaking bad news ----
 

Similaire à Into the Wild with Node.js and Web Apps

Deploy meteor in production
Deploy meteor in productionDeploy meteor in production
Deploy meteor in productionMiro Radenovic
 
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)David Neal
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JSJacob Nelson
 
V mware
V mwareV mware
V mwaredvmug1
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwaresubtitle
 
Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Sean Dague
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker composeLinkMe Srl
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from DockerJohn Griffith
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBhargav Anadkat
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platformSreenivas Kappala
 
Running Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic BeanstalkRunning Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic Beanstalkzupzup.org
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeAkihiro Suda
 
Building Open-source React Components
Building Open-source React ComponentsBuilding Open-source React Components
Building Open-source React ComponentsZack Argyle
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React ComponentsZack Argyle
 

Similaire à Into the Wild with Node.js and Web Apps (20)

Deploy meteor in production
Deploy meteor in productionDeploy meteor in production
Deploy meteor in production
 
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
 
Test like a_boss
Test like a_bossTest like a_boss
Test like a_boss
 
V mware
V mwareV mware
V mware
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMware
 
Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
Cypress for Testing
Cypress for TestingCypress for Testing
Cypress for Testing
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from Docker
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Node.js
Node.jsNode.js
Node.js
 
Nodejs
NodejsNodejs
Nodejs
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
 
Running Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic BeanstalkRunning Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic Beanstalk
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-Mode
 
Building Open-source React Components
Building Open-source React ComponentsBuilding Open-source React Components
Building Open-source React Components
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React Components
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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...Drew Madelung
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 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)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Into the Wild with Node.js and Web Apps

  • 1. INTOTHE WILD WITH NODE.JS AND WEB APPS Node.jsTalk at Klout, 2012 Chris Bumgardner Friday, April 20, 12
  • 2. ME • Co-founder and Chief-Programmer of AskYourUsers.com • @chrisbumgardner and cbumgard@gmail.com • github.com/cbumgard • My first ‘real’ production web app in Node.js • Invite only beta, going live this week. Friday, April 20, 12
  • 3. THE STACK • Node.js • Express • MongoDB • Redis • Apache Solr • Nginx / Ubuntu 11 / 2 x LinodeVPS Friday, April 20, 12
  • 4. CONFIGURATION • Partition your configuration by environment. • E.g. Config[process.env.NODE_ENV] • We have 3 environments: 2 dev and 1 production. • Environment is top-level namespace (‘dev’,‘production’, etc) for everything, including db. Keeps worlds from colliding. • Makes life easy Friday, April 20, 12
  • 5. CONFIGURATION 2 • dev env 1: sessions in memory, clean db each start. • dev env 2: persistent sessions & db, ssl. • production env: aggressive caching, ssl, live payments, clustered, fancier logging (more later), email/sms notifications. Friday, April 20, 12
  • 6. LOGGING • Log early and often. • Using Winston with the MongoDB transport. • MongoDB logging: fast writes; pass json objs in log msgs; easy ad-hoc queries; easy lru via capped collections. • Client logging from browser: caught and logged to Google Analytics as custom event. Easy monitoring/aggregation. Friday, April 20, 12
  • 7. DEPLOYMENT • Custom CI system in node that responds pushes to github • Post-Receive service hook. Github POSTs to us after a push. • CI will pull code if it’s the right branch (say ‘staging’), restart, and send SMS. • Easy and low touch.Texts from your node are nice. • Refactoring into a more modular/decoupled hook.io system. Friday, April 20, 12
  • 8. ALSO • In development: use ‘nodemon’ to start server. • Watches all files in project and restarts node if anything changes. • Great with persistent sessions, test changes immediately. • In production: use ‘forever’ to start server as daemon. Restarts node automatically if it crashes. Runs in background. Nice CLI. Manages stdout/stderr logs.Tracks multiple processes. Friday, April 20, 12
  • 9. CLUSTERING • In production, use ‘cluster’ module to fork separate node per core • App-wide initialization: if cluster.isMaster • Otherwise per-proc initialization Friday, April 20, 12
  • 10. DEPENDENCIES • Found out the hard way to control node, npm, and dependent module versions.You don’t want to push a change to production and have npm barf. No bueno. • Keep them the same on all machines. • Use npm in development. • In production I recommend bundling/controlling the deps and versions explicitly. Friday, April 20, 12
  • 11. PROFILING • ‘ab’ is your friend. • don’t forget ulimit. • Joyent has great video on profiling with dtrace. • ‘nodetime’ module: great in development, but my server got hosed when I tried it in production. Probably user error. Friday, April 20, 12
  • 12. THANKS! (you can email me at cbumgard@gmail.com) Beyond the Closed Beta, Node.js from code to production (at scale) Node.js ++ (Serverside Javascripters) Club SF Friday, April 20, 12