Node.js and Yahoo

05a8346601d9cdd6a8b62a91f29cd771?s=47 Reid Burke
February 10, 2015

Node.js and Yahoo

Node is used at Yahoo for an increasing number of our products and for building, testing, provisioning, and deploying them. Learn about where Yahoo uses Node, why we continue to use Node, and the practices that help us use Node effectively.

05a8346601d9cdd6a8b62a91f29cd771?s=128

Reid Burke

February 10, 2015
Tweet

Transcript

  1. Node.js & Yahoo

  2. Node.js & Yahoo

  3. @reid

  4. locate node

  5. yahoo.com flickr.com

  6. CI/CD Internal npm registry

  7. Yahoo & Yahoo devs

  8. Why Node?

  9. “...simple, easy-to- understand solutions that we trust.” — Instagram

  10. Our products are cutting edge

  11. Our products are cutting edge (Not our technology)

  12. Node Understood and tested for years

  13. Node Used by Yahoo devs

  14. Node Used by Yahoo devs then Yahoo itself

  15. Node Where do we use it?

  16. Node Where do we use it? For hosted apps

  17. Node Where do we use it? For hosted apps and

    building them
  18. Node Where do we use it? Building mobile apps

  19. Node Where do we use it? Building websites

  20. Node Where do we use it? Building nearly everything

  21. Hosted Apps

  22. Homepage My Yahoo Flickr Advertising Video Analytics

  23. Internal hosting platform

  24. We use Node to push Node

  25. ATS & Node

  26. 25,000 RPS

  27. CI/CD

  28. CI/CD What I work on

  29. DPS What I work on

  30. Builds orchestrated with Node

  31. ynpm install yahoo-ci -g

  32. Our Mission Everything at Yahoo built and deployed with Node

    programs
  33. Massive Central CI

  34. Docker: Crazy fast

  35. Jenkins is terrible

  36. Cinch

  37. 2,000 RPS

  38. Node for build scripts Node for build data

  39. Node for build scripts Node for build data Node for

    deploy APIs
  40. Dev Stories

  41. We took over an entire floor

  42. Deploy & Provision APIs

  43. Zero to Node

  44. 30 days

  45. Small modules

  46. RDL

  47. require (“hapi”)

  48. Shared hapi plugins for auth, routes from RDL, metrics…

  49. Validate with joi

  50. CD on day 1

  51. Dev Tools

  52. jenkins-mocha Mocha & Istanbul Tests & code coverage Puts results

    where CI expects
  53. Publish to ynpm

  54. Rapid iteration

  55. Dev Recap

  56. Source of truth Share modules Automate testing Pair programming Validate

    your inputs
  57. Devtools

  58. Local utilities Cross-platform Easy installation

  59. Errors & Metrics

  60. Tagged logs Configurable per env Easy to search

  61. Wrap errors Brief user message Verbose log message Example: verror

  62. Unwrapped myserver: Error: connect ECONNREFUSED

  63. Wrapped myserver: failed to start up: failed to load configuration:

    failed to connect to database server: failed to connect to 127.0.0.1 port 1234: connect ECONNREFUSED
  64. Example var verror = require('verror'); var err1 = new Error(

    'No such file or directory'); var err2 = new verror.VError( err1, 'failed to stat "%s"', '/junk'); var err3 = new verror.WError( err2, 'request failed'); reply(err3.message); // simple
  65. Example var verror = require('verror'); var err1 = new Error(

    'No such file or directory'); var err2 = new verror.VError( err1, 'failed to stat "%s"', '/junk'); var err3 = new verror.WError( err2, 'request failed'); console.error(err3.toString()); // verbose
  66. Recap

  67. Automate build & test Validate your inputs Wrap errors Use

    delightful tools
  68. yahoo.jobs

  69. Q&A