MEAN Stack

Post on 23-Dec-2014

191 views 0 download

Tags:

description

This is an introductory presentation to MEAN stack for web application development which is done at 99X Technology. This presentation is associated with a demonstration application of a instant group chat application which is 100% developed using MEAN stack within the 1h 30m of the presentation duration. Demonstration app: https://github.com/samiyuru/mean-stack-chat-app

Transcript of MEAN Stack

by Samiyuru Senarathne

Mean StackFast scalable web apps

Friday, July 25, 14

Who am I?

I am Samiyuru Senarathne

javascript, Objective C and java background

Web development experience in node, php, python and java

Friday, July 25, 14

What is Mean Stack?

Friday, July 25, 14

Mean Stack is!

A modern web development technology stack

express

Friday, July 25, 14

Why Mean Stack?

Friday, July 25, 14

Isn't it good to use one language everywhere

Reuse code in client and server

Scalability

Advantages & Why?

And we hope we’ll get to develop in this stack in the future

Friday, July 25, 14

JS everywhere

Isn't it too slowww....?

Friday, July 25, 14

Node vs ApacheConcurrency  Level:            20000Time  taken  for  tests:      1043.076  secondsComplete  requests:            1000000Failed  requests:                25227      (Connect:  0,  Receive:  8409,  Length:  8409,  Exceptions:  8409)Write  errors:                      0Total  transferred:            81265680  bytesHTML  transferred:              18059040  bytesRequests  per  second:        958.70  [#/sec]  (mean)Time  per  request:              20861.529  [ms]  (mean)Time  per  request:              1.043  [ms]  (mean,  across  all  concurrent  requests)Transfer  rate:                    76.08  [Kbytes/sec]  received  Connection  Times  (ms)                            min    mean[+/-­‐sd]  median      maxConnect:                0  10201  2391.8    10840      20177Processing:      595  10455  3239.1    10904      39809Waiting:                0  8323  2331.0      8728      38740Total:              1181  20656  4758.5    21795      44333

Concurrency  Level:            20000Time  taken  for  tests:      3570.753  secondsComplete  requests:            1000000Failed  requests:                2617614      (Connect:  0,  Receive:  848121,  Length:  886497,  Exceptions:  882996)Write  errors:                      0Total  transferred:            36832520  bytesHTML  transferred:              2372264  bytesRequests  per  second:        280.05  [#/sec]  (mean)Time  per  request:              71415.058  [ms]  (mean)Time  per  request:              3.571  [ms]  (mean,  across  all  concurrent  requests)Transfer  rate:                    10.07  [Kbytes/sec]  received  Connection  Times  (ms)                            min    mean[+/-­‐sd]  median      maxConnect:                0  4259  14734.0            0      79497Processing:          4  64979  51442.2    65543    381910Waiting:                0  2725  16784.2            0    249108Total:                  87  69238  56233.8    68138    426365

Friday, July 25, 14

Who uses Mean Stack

Friday, July 25, 14

Let’s jump to work

Friday, July 25, 14

Wait!

Let’s see what we are gonna use!

Friday, July 25, 14

We’ll create an app module

Will be using controllers

We’ll use angular $http service

Directivesng-app, ng-controller, ng-model, ng-click, ng-keypress, ng-repeat, ng-class, ng-if

Friday, July 25, 14

MongoDB is our database

Start mongodb in terminal

querying the db from mongo shell

Insertion & finding documents from collections

Friday, July 25, 14

Node is a platform built on Chrome's JavaScript runtime

Node uses an event-driven, non-blocking I/O model

Friday, July 25, 14

Create express app

map static files

get & post routes

respond to client in json

express

Friday, July 25, 14

Now let’s jump to work

Friday, July 25, 14

Scalability

Are you ready to scale?

Friday, July 25, 14

Vertical Scaling

Friday, July 25, 14

Horizontal Scaling

Friday, July 25, 14

No bottle necks

Mongo Node

Friday, July 25, 14

Scale Node

Node enforce shared nothing architecture

Process clustering

Friday, July 25, 14

Scale MongoDb

Friday, July 25, 14

Thank You

Friday, July 25, 14