Slide 1

Slide 1 text

Using Node.js to Build Successful Products Jacopo Daeli Lead Software Engineer @ GoDaddy Midwest JS Minneapolis, Aug 9th 2018

Slide 2

Slide 2 text

Quickly build and maintain your product

Slide 3

Slide 3 text

Schedule š 35 mins presentation š 15 mins Q&A š 10 mins break !

Slide 4

Slide 4 text

Share ❤ for JavaScript on Twitter @JacopoDaeli @midwest_js

Slide 5

Slide 5 text

Share ❤ for JavaScript on Twitter Chill is Good ". Really!

Slide 6

Slide 6 text

Node.js š Fastest growing open source platform in the world š More than twice as many modules as the next competitor (Java) š More than half million modules published š More than 450 new packages are published everyday Number of modules Source: http://www.modulecounts.com

Slide 7

Slide 7 text

Node.js Node has an estimated 7M users and is consistently growing at 100% per year. Source: https://nodejs.org/metrics

Slide 8

Slide 8 text

Node.js 81% (estimated) of the Node.js users have 3 years or less experience with Node. Source: https://nodejs.org/metrics

Slide 9

Slide 9 text

Who uses Node.js?

Slide 10

Slide 10 text

Node.js š Ryan Dahl started working on Node.js in 2009 š He was concerned about “web servers speed” š Initial release supported only Linux and Mac OS š February 2015, Node.js Foundation was announced

Slide 11

Slide 11 text

Node.js š Node.js is a runtime for JavaScript š You can run JS code server side š It has non-blocking I/O operations (Asynchronous)

Slide 12

Slide 12 text

Node.js Event Loop š Offloads operations to the System Kernel whenever possible š Modern Kernels are multi-threaded, they can handle multiple operations in background š When an operation completes, the Kernel tells Node, and the associated callback is triggered to process the result

Slide 13

Slide 13 text

Node.js is a Full Stack ecosystem š Web Frontend š Mobile & Tablet š Desktop Development š Cloud Backends š IoT Devices š 3rd Party APIs & SOA

Slide 14

Slide 14 text

Node.js is a Full Stack ecosystem š Perfect platform to deal with all these components š Node brings the accessibility and ubiquity of the web platform and of JavaScript to all these different areas š You can use Node in a variety of different places across teams

Slide 15

Slide 15 text

Web Frontend š Web Frontend development has changed drastically in the past 20 years š The community developed amazing tools in Node.js and JavaScript to help developers build front-end applications

Slide 16

Slide 16 text

Web Frontend š Babel for transpiling your JavaScript code š Standard and ESLint to maintain your code quality with ease š JSHint to help detecting errors and potential problems in your JavaScript code š Stylus, LESS, etc. for better writing CSS

Slide 17

Slide 17 text

Web Frontend š There are so many tools, that the community wrote more tools to help you manage all these tools š Examples: Gulp, Browserify, WebPack, etc.

Slide 18

Slide 18 text

Web Frontend

Slide 19

Slide 19 text

React.js š React is a JavaScript library for building User Interfaces š Project started at Facebook around 2011 and publicly released in 2013 š It rethought about front-end frameworks very differently š The main idea is that a web framework should exists in this compiled chain where we have access to Node.js

Slide 20

Slide 20 text

GraphQL š GraphQL is a data query language initially developed internally by Facebook before being publicly released in 2015 š Currently the Apollo Team leads the GraphQL community š Provides an alternative to REST and ad-hoc web service architectures

Slide 21

Slide 21 text

GraphQL š Exposes three fundamental operations: queries, mutations, and subscriptions š GraphQL is also a runtime for fulfilling those operations š Gives clients the power to ask for exactly what they need and nothing more

Slide 22

Slide 22 text

GraphQL š GraphQL makes it easier to evolve APIs over time š APIs are organized in terms of types and fields, not endpoints š It uses types to ensure Apps only ask for what’s possible

Slide 23

Slide 23 text

GraphQL š GraphQL APIs return all the data your app needs in a single request

Slide 24

Slide 24 text

GraphQL š GraphQL Summit 2018 will be on Nov 7-10 at the Regency in San Francisco š New GraphQL Apollo Server 2 is entirely written in Node.js š Therefore we can use GraphQL writing JavaScript both server and client side

Slide 25

Slide 25 text

Mobile & Tablet

Slide 26

Slide 26 text

Apache Cordova š Apache Cordova, previously known as PhoneGap š Cordova brings the entire Web platform to iOS, Android and Windows Phone using Node š All the Node tools are available across all these different devices š Cordova lets you build “mobile web apps”

Slide 27

Slide 27 text

React Native š React Native lets you build Native apps with only JavaScript š Same design as React š Not a mobile web app (or HTML app) š Same UI building blocks as regular iOS and Android apps

Slide 28

Slide 28 text

Desktop Development Desktop Development is not dead! Source: https://nodejs.org/metrics

Slide 29

Slide 29 text

Electron š Electron “merges” Chromium with Node.js š It brings the Web Platform and the entire Node ecosystem to Desktop Development š It allows developers to build cross-platform Desktop applications using HTML, JavaScript and CSS

Slide 30

Slide 30 text

Some products built with Electron

Slide 31

Slide 31 text

Cloud Backends š Node was built to build Backends š It always had a great Cloud story š Every well-known Cloud Provider supports Node out of the box and has pretty good Node support š Google App Engine, AWS Elastic Beanstalk, Heroku, etc.

Slide 32

Slide 32 text

Serverless and Function as a Service š Nowadays we are moving into the Function as a Service (a.k.a Serverless) space š Developers can build their applications out of these discrete functions š Disclaimer !: these functions run on servers, but developers don’t have to worry about it

Slide 33

Slide 33 text

Serverless and Function as a Service š Node has been Cloud vendors’ choice number one for Serverless because Node is optimized to run in a single process, with a limited memory space, and it is great to handle a lot of I/O operations š Node starts up quickly š These are very important requirements to successfully running in these Cloud Function services š Indeed, we need a really fast startup timing to be really efficient in a space with very limited resources š Moore’s Law still making computers faster, but we are keeping optimizing resources using less and less of these computers to run our apps

Slide 34

Slide 34 text

IoT Devices š Everyone wants a button to do everything ! š Starting in 2012 the Node ecosystem started to see a big rise in Robots š People working at NodeBots built a framework to build Robots in JS called “johnny-five” š Over 75 developers contributed to the project

Slide 35

Slide 35 text

IoT Devices š IoT manufactures started to support Node natively š Basically today, every IoT board device has first-class Node support š IoT manufactures know that the best way to bring developers to their platform is to bring the entire Node ecosystem to their platform as well š Tessel is probably the most popular IoT board with first-class Node.js support

Slide 36

Slide 36 text

3rd Party APIs & SOA š Everyone uses APIs to build their applications š Twilio for Text Messages, Mixpanel for Analytics, Google Speech for Speech Recognition, etc. š Most of these APIs have Node support (SDK)

Slide 37

Slide 37 text

Why I love working with Node š Node makes programming easier š Node drastically reduces the entry barrier

Slide 38

Slide 38 text

Questions? ! š twitter.com/JacopoDaeli š github.com/JacopoDaeli š [email protected]

Slide 39

Slide 39 text

Appendix 1 – Node.js Event Loop