Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Architecting for Enterprise with JavaScript

203 views

Published on

Enterprise JavaScript—business-critical applications powered by JavaScript—is a developing area that is starting to make waves in the tech industry. What makes enterprise JavaScript such an engaging topic is that there isn’t really a go-to source for understanding the differences between operating JavaScript at scale and in business-critical settings. Many developers, VPs, and CTOs are left guessing or scraping blog posts in order to try and make informed decisions with regard to JavaScript in a large organization.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Architecting for Enterprise with JavaScript

  1. 1. ARCHITECTING FOR ENTERPRISE WITH JAVASCRIPT
  2. 2. Tech Lead @ MLS : @kurtiskemple : @kurtiskemple : @kkemple
  3. 3. WHAT SHOULD I EXPECT?
  4. 4. BENEFITS OF USING JAVASCRIPT IN ENTERPRISE
  5. 5. SAME LANGUAGE ACROSS APPLICATIONS / PLATFORMS
  6. 6. INCREASED VELOCITY
  7. 7. NODE.JS AT PAYPAL - JAVASCRIPT VS JAVA • Built the same application in almost half the time • Written with 33% fewer lines of code • Constructed with 40% fewer files https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal
  8. 8. IMPROVED APPLICATION PERFORMANCE
  9. 9. https://strongloop.com/strongblog/node-js-is-faster-than-java
  10. 10. https://strongloop.com/strongblog/node-js-is-faster-than-java
  11. 11. https://www.youtube.com/watch?v=8aGhZQkoFbQ
  12. 12. LARGER ECOSYSTEM
  13. 13. http://www.modulecounts.com/
  14. 14. https://unpm.nodesource.com
  15. 15. LARGER TALENT POOL
  16. 16. http://stackoverflow.com/research/developer-survey-2016
  17. 17. BENEFITS OF JAVASCRIPT - RECAP • Same Language Across Apps / Platforms • Increased Velocity • Improved Application Performance • Larger Ecosystem • Larger Talent Pool
  18. 18. COMMON TRAPS AND PITFALLS
  19. 19. VELOCITY IS THE MEASURE OF YOUR ABILITY TO ADAPT ” “ - Eric Elliot https://ericelliottjs.com/product/tdd-es6-react/
  20. 20. MOVING TOO FAST
  21. 21. FRAGILE SYSTEMS
  22. 22. USING CLASSICAL INHERITANCE PATTERNS
  23. 23. WHY?
  24. 24. FAVOR OBJECT COMPOSITION OVER CLASS INHERITANCE. ” “ - The Gang of Four Design Patterns: Elements of Reusable Object Oriented Software
  25. 25. https://www.youtube.com/watch?v=lKCCZTUx0sI
  26. 26. COMMON ISSUES FACED WITH CLASSICAL INHERITANCE • Tight Coupling • Gorilla/Banana Problem • Duplication By Necessity Fluent 2013 - Eric Elliot, "Classical Inheritance is Obsolete"
  27. 27. INCONSISTENT CODE STYLES AND ARCHITECTURAL PATTERNS
  28. 28. ENTROPY
  29. 29. EVERYTHING IS NOT A NAIL
  30. 30. COMMON TRAPS AND PITFALLS - RECAP •Moving Too Fast •Fragile Systems •Using Classical Inheritance (Deep) •Inconsistent Code Styles / Architectural Patterns •Entropy •Everything Is Not A Nail
  31. 31. CODE QUALITY
  32. 32. WHAT MAKES QUALITY CODE?
  33. 33. F.I.R.S.T. PRINCIPLE
  34. 34. F.I.R.S.T. PRINCIPAL • Focused • Independent • Reusable • Small • Testable
  35. 35. WHETHER IT’S A CLIENT OR SERVER-SIDE COMPONENT, A NODE MODULE OR A PIECE OF VISUAL UI, COMPONENTS THAT ARE LARGE ARE INHERENTLY MORE COMPLEX TO MAINTAIN THAN THOSE THAT ARE SMALL ” “ - Addy Osmani https://addyosmani.com/first
  36. 36. DISCOVERABLE
  37. 37. DISCOVERABILITY IS THE DEGREE TO WHICH YOU CAN FIGURE OUT HOW TO USE SOMETHING SIMPLY BY PLAYING WITH AND EXAMINING IT. ” “ - Erik Dietrich http://www.daedtech.com
  38. 38. HOW CAN WE MAKE CODE DISCOVERABLE?
  39. 39. HOW TO MAKE CODE DISCOVERABLE • Documentation • Tests • Typing • Declarative Naming Patterns • Cohesive File Structure
  40. 40. SETTING STANDARDS
  41. 41. 👍 👍
  42. 42. CODE QUALITY - RECAP • Follow the F.I.R.S.T. Principal • Code Should Be Discoverable • It’s Important to Set and Enforce Standards • PR’s Are a Great Way To Ensure Consistency
  43. 43. FINE TUNING YOUR ENVIRONMENT
  44. 44. VELOCITY IS THE MEASURE OF YOUR ABILITY TO ADAPT ” “ - Eric Elliot https://ericelliottjs.com/product/tdd-es6-react/
  45. 45. UNIT TESTING
  46. 46. http://www.seguetech.com/the-benefits-of-unit-testing
  47. 47. WHAT DEFINES A UNIT?
  48. 48. AN INDIVIDUAL THING OR PERSON REGARDED AS SINGLE AND COMPLETE BUT WHICH CAN ALSO FORM AN INDIVIDUAL COMPONENT OF A LARGER OR MORE COMPLEX WHOLE ” “ - The Dictionary
  49. 49. UNIT TESTING IS A SOFTWARE DEVELOPMENT PROCESS IN WHICH THE SMALLEST TESTABLE PARTS OF AN APPLICATION, CALLED UNITS, ARE INDIVIDUALLY AND INDEPENDENTLY SCRUTINIZED FOR PROPER OPERATION ” “ http://searchsoftwarequality.techtarget.com/definition/unit-testing - Tech Target
  50. 50. MEDIUMEST??
  51. 51. BLACK BOX TESTING
  52. 52. BLACK-BOX TESTING IS A METHOD OF SOFTWARE TESTING THAT EXAMINES THE FUNCTIONALITY OF AN APPLICATION WITHOUT PEERING INTO ITS INTERNAL STRUCTURES OR WORKINGS ” “
  53. 53. THIS METHOD CAN BE APPLIED TO VIRTUALLY EVERY LEVEL OF SOFTWARE TESTING… ” “ https://en.wikipedia.org/wiki/Black-box_testing - Wikipedia
  54. 54. Test Input Unit Success Failure
  55. 55. CLOSING THE FEEDBACK LOOP
  56. 56.
  57. 57.
  58. 58. MANAGING DEPENDENCIES
  59. 59. Private Registries Yarn Shrink Pack Rollup DEPENDENCY MANAGEMENT STRATEGIES Docker
  60. 60. #LEFTPAD
  61. 61. HANDLING ERRORS
  62. 62. PROCESS EVENTS TO HANDLE • Uncaught Exception • Unhandled Rejection • SIGTERM
  63. 63. http://blog.getsentry.com
  64. 64. GETTING PREVENTATIVE
  65. 65. https://flowtype.org
  66. 66. SECURING YOUR RUNTIME
  67. 67. NODE LONG TERM SUPPORT VERSIONS
  68. 68. https://github.com/nodejs/LTS
  69. 69. https://nodesource.com/products/nsolid
  70. 70. N|SOLID FEATURES • Package Vulnerability Monitoring • 24 Hr Security Patch Integration • Threshold and Process Monitoring • Drop In Node Replacement
  71. 71. FINE TUNING YOUR ENVIRONMENT - RECAP • Avoid Over Unit Testing • Black Box Testing Can Help Solve Over Testing • Closing the Feedback Loop Increases Velocity • You Must Manage Your Dependencies • You Must Handle Errors • Securing Your Runtime Is Important
  72. 72. DEPLOYMENTS AND MONITORING
  73. 73. DEPLOYING WITH DOCKER
  74. 74. service:b01 STAGING --tag prod PROD service:prod
  75. 75. DEPLOYING SANS DOCKER
  76. 76. https://zeit.co/now
  77. 77. DEPLOYING STATIC WEB APPS
  78. 78. https://surge.sh
  79. 79. https://pages.github.com
  80. 80. AUTOMATION IS 🔑
  81. 81. WOW! WE’RE IDENTICAL!
  82. 82. ENGINEERS DELIVERABLES
  83. 83. MONITORING & CUSTOM METRICS
  84. 84. APPLICATION PERFORMANCE MONITORING • Requests Per Minute • Throughput • Time Spent in Execution
  85. 85. https://newrelic.com
  86. 86. PROCESS MONITORING • Memory Usage • CPU Usage • Network Usage
  87. 87. https://nodesource.com/products/nsolid
  88. 88. https://segment.com
  89. 89. DEPLOYMENTS AND MONITORING - RECAP • Deploying with Docker Provides Application Versioning • Now.sh is a Great Solution for Node Deployments • Deploying Static Web Apps Is Easy Too • Automation is Key • Stated Is Great For Custom Metrics • Segment Is Great For Business Analytics
  90. 90. MANAGING RELIABILITY
  91. 91. SERVICE LEVEL OBJECTIVES
  92. 92. A TARGET VALUE FOR A SERVICE LEVEL THAT IS MEASURED BY A GIVEN METRIC - Site Reliability Engineering http://shop.oreilly.com/product/0636920041528.do
  93. 93. BENEFITS OF SLOs • Easily measurable • Quickly identify regressions • Easy to align with KPIs • Provides clear improvement paths
  94. 94. EXAMPLES OF SLOs • 99% Service Uptime per Quarter • Able to Serve 1000 RPM • < 500ms Response Times • 100k Concurrent Connections • < 1s To First Usable Render
  95. 95. ERROR LIMITS
  96. 96. EXAMPLES OF ERROR LIMITS • 1% Service Downtime per Quarter • < 900 RPM • > 600ms Response Times • < 90k Concurrent Connections • > 1s To First Usable Render
  97. 97. MANAGING RISK - RECAP • Managing Risk Allows You to Fine Tune Your Velocity • Service Level Objectives Provide Goals for Systems • Error Limits Are Used To Gauge Risk Introduced
  98. 98. CULTURE SHIFT
  99. 99. YOU CAN EITHER EMBRACE CHANGE OR YOU CAN BRACE FOR CHANGE ” “ - Emily Webber http://www.slideshare.net/turingfestival/emily-webber
  100. 100. FOSTER AN ENVIRONMENT OF LEARNING
  101. 101. POWER TO THE DEVELOPERS! 👊
  102. 102. https://www.youtube.com/watch?v=DGK6jjamzfY
  103. 103. EMPOWERING DEVELOPERS • Purpose driven culture • Whoever builds it, runs it • From project to product
  104. 104. START SMALL
  105. 105. CULTURE SHIFT - RECAP • You Must Embrace Change • Foster An Environment of Learning • Give Power to Your Developers • Start Small
  106. 106. Q&A
  107. 107. ARCHITECTING FOR ENTERPRISE WITH JAVASCRIPT : @kurtiskemple : @kurtiskemple : @kkemple

×