SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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 ----
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Kürzlich hochgeladen (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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure 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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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