SlideShare a Scribd company logo
Intro to the MEAN Stack
Using NodeJS to drive superheroic web apps

Valeri Karpov
Kernel Tools Engineer, MongoDB
thecodebarbarian.com
github.com/vkarpov15
@code_barbarian
Who is this guy?
CTO 2008
What does MEAN mean?
MongoDB - document database
ExpressJS - web framework for NodeJS
AngularJS - client MVVM, server ⇔ UX
NodeJS - event-driven IO in Javascript
What is this talk about?
- Building a new web app: its easy…
- … except when it isn’t
Expectation

Reality
The Problem Categories
Your problems look something like this:
Prototype. Build a usable product fast
Adapt. Iterate on feedback
Test. Automate testing using CI
Scale. Utilize server resources efficiently
Prototype
“Done is better than perfect.”
- Facebook developer mantra
Prototype
- Goal: Get usable product in users’ hands fast
- Success story: Ascot Project
Prototype
- Surface: one language makes life easier
- Surface: package management
- Deeper: tight binding from database to client
Start with a UI
Interactive client-side templating
Client-side: JSON bound to state of view
Server View of Data
Interactive client-side templating
Server receives JSON data as-is
Database View of Data
Interactive client-side templating
MongoDB stores JSON data as-is
Why is this useful?
- Lower barrier to entry for new devs
- Declarative UX
- Easier debugging
- Code reuse
Adapt
“There's a plaque on our wall that says we've
sold over 65 million albums, and I don't feel I've
accomplished anything. I feel like I'm just
getting started.”
- Eddie Van Halen
Adapt
- Application always starts out simple, but...

- REST APIs. Socket APIs. SMTP.
- How will you integrate with new tech?
The NodeJS Advantage
- Threads and locks are difficult
- Cron jobs are difficult
- Your server needs to be concurrent
- NodeJS provides easy, testable concurrency
Best Case Scenario
- Bitcoin arbitrage from apartment
- 1 hour from nothing to live trading
- 15 minutes to add a new exchange
Test
“Beware of bugs in the above code; I have only
proved it correct, not tried it.”
- Donald Knuth, former Stanford CS Professor
The Challenge
How do you prove your code works?
Success story: Bookalokal
The Evolution of Testing
- Manual testing?
- Unit tests?
- E2E tests?
- Test runners?
- Continuous Integration.
MEAN Stack Advantage
- Javascript makes unit testing very easy
- Trivial dependency injection:
- AngularJS has built-in DI
- Lots of NodeJS DI, recommend
https://npmjs.org/package/omni-di
MEAN Stack Advantage
- E2E tests: angular-scenario
Karma test-runner
- http://karma-runner.github.io
- Launch browsers, run tests on file save
- Compatibility: angular-scenario, nodeunit,
jasmine
Karma and CI
- Jenkins: http://bit.ly/1fVqoC9
- Circle CI: http://bit.ly/1dhuR4A
- Travis CI: http://bit.ly/I3ojbF
- Semaphore: http://bit.ly/IgiWFz
Scale
“Go Big or Go Extinct”
- Tagline to the 2013 film Pacific Rim
A Word of Caution...
Scalability is (mostly) a Maserati Problem

http://bit.ly/17gOvUO (Moderately NSFW)
Scale… to what?
- Difficult to judge exact number, say O(1000)
- Single machine
- 20% of mistakes 80% of new apps make
- Horror story: SCNVGR, 10/18/08
What are the key points?
- Don’t be Schlemiel the Painter
Bandwidth is scarce
- Is the browser caching static assets?
- Is your CSS and JS minified?
- Grunt everybody’s favorite minifier
- Bonus minify css/js on server start using
uglify-js.
Hard drive is slow
- Especially true on EC2 - not an actual HD!
- Is your database reading from HD?
- MongoDB: In-memory “caching” built in! :)
Don’t choke the CPU
- Is your server single-threaded?
- NodeJS: You get this for free! :)
A Common Criticism
Will MEAN be obsolete in 5 years? I hope so.

“To know ten thousand things, know one thing
well.”
- The Book of Five Rings by Miyamoto Musashi
Thanks for Listening!
Comments, questions, haikus?
Read more at:
thecodebarbarian.com
github.com/vkarpov15
@code_barbarian

More Related Content

PDF
The MEAN Stack
PPTX
Introduction to mean stack
PPTX
MEAN stack
PPT
Get MEAN! Node.js and the MEAN stack
PPTX
PDF
Mean Stack - An Overview
PPTX
Angular js introduction
PPTX
MEAN Stack
The MEAN Stack
Introduction to mean stack
MEAN stack
Get MEAN! Node.js and the MEAN stack
Mean Stack - An Overview
Angular js introduction
MEAN Stack

What's hot (20)

PDF
Introduction to the MEAN stack
PPT
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
PDF
LAMP is so yesterday, MEAN is so tomorrow! :)
PDF
MongoDB and the MEAN Stack
PDF
MEAN Stack
PPTX
You know what iMEAN? Using MEAN stack for application dev on Informix
PPTX
Mern stack developement
PPTX
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
PPT
Beyond the MEAN Stack: Thinking Small with Node.js for the Enterprise
PDF
MEAN Stack - Google Developers Live 10/03/2013
PPTX
Rapid Application Development with MEAN Stack
PDF
The MEAN stack - SoCalCodeCamp - june 29th 2014
PDF
Beginning MEAN Stack
PPTX
Kick start your journey as mern stack developer
PPTX
Mean full stack development
PPTX
MEAN Stack
PDF
Nodejs
PPTX
Building your first MEAN application
PPTX
Starting from Scratch with the MEAN Stack
Introduction to the MEAN stack
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
LAMP is so yesterday, MEAN is so tomorrow! :)
MongoDB and the MEAN Stack
MEAN Stack
You know what iMEAN? Using MEAN stack for application dev on Informix
Mern stack developement
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
Beyond the MEAN Stack: Thinking Small with Node.js for the Enterprise
MEAN Stack - Google Developers Live 10/03/2013
Rapid Application Development with MEAN Stack
The MEAN stack - SoCalCodeCamp - june 29th 2014
Beginning MEAN Stack
Kick start your journey as mern stack developer
Mean full stack development
MEAN Stack
Nodejs
Building your first MEAN application
Starting from Scratch with the MEAN Stack
Ad

Viewers also liked (20)

PDF
소셜 코딩 GitHub & branch & branch strategy
PDF
Mean stack Start
PDF
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
PDF
MEAN Stack Workshop at Node Philly, 4/9/14
PDF
MongoDB Israel June Meetup
PDF
Mongo db in 3 minutes BoilerMake
PDF
Conquering AngularJS Limitations
PDF
JS-IL: Getting MEAN in 1 Hour
PDF
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
PDF
AngularJS Meetup 11/19/13 - AngularJS for MongoDB Continuous Integration
PDF
Cache governance
PDF
Social Dev Trend
PPTX
20151022 elasticsearch 적용및활용_송준이_sds발표용
PDF
Lessons in Open Source from the MongooseJS ODM
PDF
MongoDB: Queries and Aggregation Framework with NBA Game Data
PDF
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
PDF
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
PDF
TDD a REST API With Node.js and MongoDB
PDF
Amazon Elastcsearch Service 소개 및 활용 방법 (윤석찬)
PDF
[2D1]Elasticsearch 성능 최적화
소셜 코딩 GitHub & branch & branch strategy
Mean stack Start
MongoDB Miami Meetup 1/26/15: Introduction to WiredTiger
MEAN Stack Workshop at Node Philly, 4/9/14
MongoDB Israel June Meetup
Mongo db in 3 minutes BoilerMake
Conquering AngularJS Limitations
JS-IL: Getting MEAN in 1 Hour
JS-IL Keynote: MongoDB 2.6, Mongoose 4.0, and Beyond
AngularJS Meetup 11/19/13 - AngularJS for MongoDB Continuous Integration
Cache governance
Social Dev Trend
20151022 elasticsearch 적용및활용_송준이_sds발표용
Lessons in Open Source from the MongooseJS ODM
MongoDB: Queries and Aggregation Framework with NBA Game Data
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
TDD a REST API With Node.js and MongoDB
Amazon Elastcsearch Service 소개 및 활용 방법 (윤석찬)
[2D1]Elasticsearch 성능 최적화
Ad

Similar to NodeSummit - MEAN Stack (20)

PDF
Top 50 Node.js Interview Questions and Answers | Edureka
PPTX
Nodejs overview
PPTX
Introduction to Node.js
PDF
Create Restful Web Application With Node.js Express Framework
PDF
Node.JS briefly introduced
PDF
MongoDB World 2016: Get MEAN and Lean with MongoDB and Kubernetes
PPT
Node js
PPTX
NodeJS and what is actually does
PDF
Learning Nodejs For Net Developers Harry Cummings
PDF
Continous UI testing with Espresso and Jenkins
PDF
Node JS Roadmap for Beginners By Scholarhat PDF
PPTX
What is Mean Stack Development ?
PPTX
Node js Introduction
PPTX
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
PDF
Intro to Node.js (for .NET Developers)
PDF
JavaScript development methodology
PDF
Node JS Express: Steps to Create Restful Web App
PDF
Surrogate dependencies (in node js) v1.0
PPTX
Meteor Introduction
PDF
Node, express & sails
Top 50 Node.js Interview Questions and Answers | Edureka
Nodejs overview
Introduction to Node.js
Create Restful Web Application With Node.js Express Framework
Node.JS briefly introduced
MongoDB World 2016: Get MEAN and Lean with MongoDB and Kubernetes
Node js
NodeJS and what is actually does
Learning Nodejs For Net Developers Harry Cummings
Continous UI testing with Espresso and Jenkins
Node JS Roadmap for Beginners By Scholarhat PDF
What is Mean Stack Development ?
Node js Introduction
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Intro to Node.js (for .NET Developers)
JavaScript development methodology
Node JS Express: Steps to Create Restful Web App
Surrogate dependencies (in node js) v1.0
Meteor Introduction
Node, express & sails

More from Valeri Karpov (11)

PDF
A Practical Introduction to GeoJSON
PDF
A Practical Introduction to Functions-as-a-Service
PDF
A Gentle Introduction to Functions-as-a-Service
PDF
Introducing Async/Await
PDF
TAO and the Essence of Modern JavaScript
PDF
Mastering Async/Await in JavaScript
PDF
React, Redux, and Archetype
PDF
MongoDB MEAN Stack Webinar October 7, 2015
PDF
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
PDF
MongoDB API Talk @ HackPrinceton
PDF
MEAN Stack WeNode Barcelona Workshop
A Practical Introduction to GeoJSON
A Practical Introduction to Functions-as-a-Service
A Gentle Introduction to Functions-as-a-Service
Introducing Async/Await
TAO and the Essence of Modern JavaScript
Mastering Async/Await in JavaScript
React, Redux, and Archetype
MongoDB MEAN Stack Webinar October 7, 2015
MEAN Stack NYC Meetup 20150717: TDD Your AngularJS + Ionic Directives With jQ...
MongoDB API Talk @ HackPrinceton
MEAN Stack WeNode Barcelona Workshop

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Modernizing your data center with Dell and AMD
Chapter 3 Spatial Domain Image Processing.pdf
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation

NodeSummit - MEAN Stack

  • 1. Intro to the MEAN Stack Using NodeJS to drive superheroic web apps Valeri Karpov Kernel Tools Engineer, MongoDB thecodebarbarian.com github.com/vkarpov15 @code_barbarian
  • 2. Who is this guy? CTO 2008
  • 3. What does MEAN mean? MongoDB - document database ExpressJS - web framework for NodeJS AngularJS - client MVVM, server ⇔ UX NodeJS - event-driven IO in Javascript
  • 4. What is this talk about? - Building a new web app: its easy… - … except when it isn’t Expectation Reality
  • 5. The Problem Categories Your problems look something like this: Prototype. Build a usable product fast Adapt. Iterate on feedback Test. Automate testing using CI Scale. Utilize server resources efficiently
  • 6. Prototype “Done is better than perfect.” - Facebook developer mantra
  • 7. Prototype - Goal: Get usable product in users’ hands fast - Success story: Ascot Project
  • 8. Prototype - Surface: one language makes life easier - Surface: package management - Deeper: tight binding from database to client
  • 9. Start with a UI Interactive client-side templating Client-side: JSON bound to state of view
  • 10. Server View of Data Interactive client-side templating Server receives JSON data as-is
  • 11. Database View of Data Interactive client-side templating MongoDB stores JSON data as-is
  • 12. Why is this useful? - Lower barrier to entry for new devs - Declarative UX - Easier debugging - Code reuse
  • 13. Adapt “There's a plaque on our wall that says we've sold over 65 million albums, and I don't feel I've accomplished anything. I feel like I'm just getting started.” - Eddie Van Halen
  • 14. Adapt - Application always starts out simple, but... - REST APIs. Socket APIs. SMTP. - How will you integrate with new tech?
  • 15. The NodeJS Advantage - Threads and locks are difficult - Cron jobs are difficult - Your server needs to be concurrent - NodeJS provides easy, testable concurrency
  • 16. Best Case Scenario - Bitcoin arbitrage from apartment - 1 hour from nothing to live trading - 15 minutes to add a new exchange
  • 17. Test “Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth, former Stanford CS Professor
  • 18. The Challenge How do you prove your code works? Success story: Bookalokal
  • 19. The Evolution of Testing - Manual testing? - Unit tests? - E2E tests? - Test runners? - Continuous Integration.
  • 20. MEAN Stack Advantage - Javascript makes unit testing very easy - Trivial dependency injection: - AngularJS has built-in DI - Lots of NodeJS DI, recommend https://npmjs.org/package/omni-di
  • 21. MEAN Stack Advantage - E2E tests: angular-scenario
  • 22. Karma test-runner - http://karma-runner.github.io - Launch browsers, run tests on file save - Compatibility: angular-scenario, nodeunit, jasmine
  • 23. Karma and CI - Jenkins: http://bit.ly/1fVqoC9 - Circle CI: http://bit.ly/1dhuR4A - Travis CI: http://bit.ly/I3ojbF - Semaphore: http://bit.ly/IgiWFz
  • 24. Scale “Go Big or Go Extinct” - Tagline to the 2013 film Pacific Rim
  • 25. A Word of Caution... Scalability is (mostly) a Maserati Problem http://bit.ly/17gOvUO (Moderately NSFW)
  • 26. Scale… to what? - Difficult to judge exact number, say O(1000) - Single machine - 20% of mistakes 80% of new apps make - Horror story: SCNVGR, 10/18/08
  • 27. What are the key points? - Don’t be Schlemiel the Painter
  • 28. Bandwidth is scarce - Is the browser caching static assets? - Is your CSS and JS minified? - Grunt everybody’s favorite minifier - Bonus minify css/js on server start using uglify-js.
  • 29. Hard drive is slow - Especially true on EC2 - not an actual HD! - Is your database reading from HD? - MongoDB: In-memory “caching” built in! :)
  • 30. Don’t choke the CPU - Is your server single-threaded? - NodeJS: You get this for free! :)
  • 31. A Common Criticism Will MEAN be obsolete in 5 years? I hope so. “To know ten thousand things, know one thing well.” - The Book of Five Rings by Miyamoto Musashi
  • 32. Thanks for Listening! Comments, questions, haikus? Read more at: thecodebarbarian.com github.com/vkarpov15 @code_barbarian