nodejs - building a restful api
DESCRIPTION
TRANSCRIPT
Success Stories
Built a Node version of a Java app
half the time with fewer developers
to
Ref: https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/
Success Stories
“Velocity was the key driving point for PayPal's move to Node. We found it enabled a huge boost to our workflow allowing us to iterate faster and innovate more.”
–Jeff Harrel, Director of User Interface Engineering
Success Stories
Easily serving 50,000 requests/minute
Handling the same amount of traffic as before but with less hardware.
Ref: http://www.slideshare.net/joemccann/the-business-case-for-node
Success Stories
Ref: http://www.slideshare.net/joemccann/the-business-case-for-node
55% of all traffic on Black Friday went to Node servers.
Not a single Node server went down. Zero.
Success Stories
Ref: http://www.slideshare.net/joemccann/the-business-case-for-node
CPU Utilization hovered around 1%.
Developers “were bored” that day.
Agenda
Application Stack
Deployment Stack
Configurations
Routing
Authentication/Authorization
Testing
Deployment
Monitoring
Application Stack
RESTful API
ExpressJS
Mongoose
MongoDB Memory Caching
Controller
Key-Value Handler
Testing
• Config package.json
• make test
• Setup multi testing environment
Process.env.NODE_ENV = “(environment name)”
Reference
1. Nodejs - http://nodejs.org/
2. Expressjs - http://expressjs.com/
3. MongoDB - https://www.mongodb.org/
4. Mongoose –mongoosejs.com
5. Request - https://www.npmjs.org/package/request
6. Es6-Promise - https://www.npmjs.org/package/es6-promise
7. NewRelic - http://newrelic.com/application-monitoring
8. Travis CI - https://travis-ci.org/
9. Heroku Cloud - https://www.heroku.com/