87
@dkhan Netflix, Tinder, NASA – Node.js und die Digitale Transformation Daniel Khan Node.js Technology Lead

Intro to Node.js (German)

Embed Size (px)

Citation preview

Page 1: Intro to Node.js (German)

@dkhan

Netflix, Tinder, NASA – Node.js und die Digitale TransformationDaniel KhanNode.js Technology Lead

Page 2: Intro to Node.js (German)

Daniel Khan• @dkhan• [email protected]• Node.js Technology Lead

Page 3: Intro to Node.js (German)

www.dynatrace.com

@dkhan

Page 4: Intro to Node.js (German)

@dkhan

Gegründet in Linz 2006210 Mitarbeiter in LinzWeltweit ca. 2.000#2 Arbeitgeber Ranking

Page 5: Intro to Node.js (German)

@dkhan

Page 6: Intro to Node.js (German)

@dkhan

Page 7: Intro to Node.js (German)

@dkhan

Page 8: Intro to Node.js (German)

@dkhan

Page 9: Intro to Node.js (German)

@dkhan

Page 10: Intro to Node.js (German)

@dkhan

Page 11: Intro to Node.js (German)
Page 12: Intro to Node.js (German)
Page 13: Intro to Node.js (German)

@dkhan

Page 15: Intro to Node.js (German)

Complete Transaction CoverageBrowser / Native Mobile Java/

.NET

PerformanceWarehouse

PurePathCollector

DynatraceServer

DynatraceClient

SessionsStore

ExportedSession

OfflineSession Analysis

Web Server/ PHP

C++, VB, ADK

CICS

Mainframez/OS

MQ/ESB

Database

Page 16: Intro to Node.js (German)
Page 17: Intro to Node.js (German)

@dkhan

Page 18: Intro to Node.js (German)

@dkhan

Page 19: Intro to Node.js (German)

@dkhan

Page 20: Intro to Node.js (German)

@dkhan

Page 21: Intro to Node.js (German)

@dkhanQuelle: Indeed Job Trends

Page 22: Intro to Node.js (German)

@dkhan

Relativ!

Quelle: Indeed Job Trends

Page 23: Intro to Node.js (German)

@dkhan

Node@Dynatrace | März 2015

Page 24: Intro to Node.js (German)

@dkhan

Page 25: Intro to Node.js (German)

@dkhan

Page 26: Intro to Node.js (German)

@dkhan

Page 27: Intro to Node.js (German)

@dkhan

Page 28: Intro to Node.js (German)

@dkhan

Page 29: Intro to Node.js (German)

@dkhan

Page 30: Intro to Node.js (German)

@dkhan

Page 31: Intro to Node.js (German)

@dkhan

Page 32: Intro to Node.js (German)

@dkhan

Page 33: Intro to Node.js (German)

@dkhan

Page 34: Intro to Node.js (German)

@dkhan

Page 35: Intro to Node.js (German)

@dkhan

Page 36: Intro to Node.js (German)

@dkhan

Page 37: Intro to Node.js (German)

@dkhan

Page 38: Intro to Node.js (German)

@dkhan

Bestehende KundenNicht unbedingt Startups

Page 39: Intro to Node.js (German)

Node Foundation

Page 40: Intro to Node.js (German)
Page 41: Intro to Node.js (German)

@dkhan

“Digital Transformation”

Page 42: Intro to Node.js (German)

We see ourselves as a technology company with a banking license

“”Michael Corbat

PDG de Citi

Page 43: Intro to Node.js (German)

Nike has many more software developers in Oregon than

apparel designers.*

“”*from Dynatrace Perform 2015

Page 44: Intro to Node.js (German)

@dkhan

Page 45: Intro to Node.js (German)

@dkhan

Page 46: Intro to Node.js (German)

@dkhan

November 2016“Wir sehen Node.js überall in den USA’

Page 47: Intro to Node.js (German)

@dkhan

Quelle: IBM/StrongLoop

Page 48: Intro to Node.js (German)

@dkhan

Node.js komplementiert bestehende Systeme

Page 49: Intro to Node.js (German)

@dkhan

Page 50: Intro to Node.js (German)

@dkhan

Page 51: Intro to Node.js (German)

@dkhan

Page 52: Intro to Node.js (German)

@dkhan

Page 53: Intro to Node.js (German)

@dkhan

Page 54: Intro to Node.js (German)

@dkhan

Page 55: Intro to Node.js (German)

@dkhan

Aber warum ausgerechnet Node.js?

Page 56: Intro to Node.js (German)

@dkhan

JavaScript• Easy to learn / easy to find developers• No language boundaries between frontend and backend• Easy to deploy and rollback• Fast development cycles

PayPal built a web app side by side in Node and Javaand the Node version was:• Built almost twice as fast with fewer people• Written in 33% fewer lines of code• Constructed with 40% fewer files

Source: https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/

Page 57: Intro to Node.js (German)

@dkhan

Performance• Google V8 JavaScript Engine• Non-Blocking I/O• Asynchronous event based execution

Node.js shines in modern web-connected applications where it needs togather data from different sources, consolidate it and push it to manyclients in real-time.

Never(!) use it for CPU-bound tasks!

Page 58: Intro to Node.js (German)

Source: PayPal

Double the requests per second vs. the Java application.

35% decrease in the average response time

Page 59: Intro to Node.js (German)

@dkhan

Usecases

• Authentifizierung / Autorisierung• Proxy / Vermittler• Datentransformation• Präsentation (HTML)

Page 60: Intro to Node.js (German)

Node.js in a Nutshell

Page 61: Intro to Node.js (German)

@dkhan

Node Standard Library

Node Bindings

V8 Thread Pool

Event Loop

JavaScript

C++

Page 62: Intro to Node.js (German)

@dkhan

Page 63: Intro to Node.js (German)

@dkhan

Page 64: Intro to Node.js (German)

@dkhan

“Asynchronous I/O"

Page 65: Intro to Node.js (German)

DatabaseBrowser Java Application

1 Thread per request

If number of max threads is exhausted requests are

blocked

Threads are waiting, doing nothing

Thread context switches, synchronization necessary

Traditional approach

Page 66: Intro to Node.js (German)

DatabaseBrowser Node.js Application

IO Threads

Event-handling in 1 Thread

Reduced waiting time

More concurrent requests possible

No synchronization necessary

Nodes approach

Page 67: Intro to Node.js (German)

@dkhan

“Node.js ist Single Threaded”

Page 68: Intro to Node.js (German)

@dkhan

Page 69: Intro to Node.js (German)

calculateFibonacci();

Page 70: Intro to Node.js (German)

@dkhan

Die Event Loop

Page 71: Intro to Node.js (German)
Page 72: Intro to Node.js (German)
Page 73: Intro to Node.js (German)
Page 74: Intro to Node.js (German)
Page 75: Intro to Node.js (German)
Page 76: Intro to Node.js (German)
Page 77: Intro to Node.js (German)

@dkhan

Erste Schritte zu einer Node.js Applikation

Page 78: Intro to Node.js (German)

@dkhan

Über 350.000 Module auf npm

Page 79: Intro to Node.js (German)

@dkhan

Page 80: Intro to Node.js (German)

@dkhan

Page 81: Intro to Node.js (German)

@dkhan

Page 82: Intro to Node.js (German)

@dkhan

Page 83: Intro to Node.js (German)

@dkhan

Page 84: Intro to Node.js (German)

@dkhan

• JavaScript ist einfach• Dynamisch typisiert• Einfache API für

asynchrone Tasks• Erstklassige I/O

Performance• Einfaches Deployment

• JavaScript ist einfach• Dynamisch typisiert• Nicht geeignet für CPU-

Aufwändige Aufgaben• Events und Callbacks führen zu

komplizierten Strukturen (Callback Hell)

Contra:Pro:

Page 85: Intro to Node.js (German)

@dkhan

Page 86: Intro to Node.js (German)

@dkhan

If all you have is a hammer, everything looks like a nail

Abraham Maslow, 1966

Page 87: Intro to Node.js (German)

@dkhan

Thank You! | Daniel Khan | @dkhan | [email protected]