Upload
daniel-khan
View
48
Download
0
Embed Size (px)
Citation preview
@dkhan
Netflix, Tinder, NASA – Node.js und die Digitale TransformationDaniel KhanNode.js Technology Lead
Daniel Khan• @dkhan• [email protected]• Node.js Technology Lead
www.dynatrace.com
@dkhan
@dkhan
Gegründet in Linz 2006210 Mitarbeiter in LinzWeltweit ca. 2.000#2 Arbeitgeber Ranking
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
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
@dkhan
@dkhan
@dkhan
@dkhan
@dkhanQuelle: Indeed Job Trends
@dkhan
Relativ!
Quelle: Indeed Job Trends
@dkhan
Node@Dynatrace | März 2015
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
Bestehende KundenNicht unbedingt Startups
Node Foundation
@dkhan
“Digital Transformation”
We see ourselves as a technology company with a banking license
“”Michael Corbat
PDG de Citi
Nike has many more software developers in Oregon than
apparel designers.*
“”*from Dynatrace Perform 2015
@dkhan
@dkhan
@dkhan
November 2016“Wir sehen Node.js überall in den USA’
@dkhan
Quelle: IBM/StrongLoop
@dkhan
Node.js komplementiert bestehende Systeme
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
Aber warum ausgerechnet Node.js?
@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/
@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!
Source: PayPal
Double the requests per second vs. the Java application.
35% decrease in the average response time
@dkhan
Usecases
• Authentifizierung / Autorisierung• Proxy / Vermittler• Datentransformation• Präsentation (HTML)
Node.js in a Nutshell
@dkhan
Node Standard Library
Node Bindings
V8 Thread Pool
Event Loop
JavaScript
C++
@dkhan
@dkhan
@dkhan
“Asynchronous I/O"
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
DatabaseBrowser Node.js Application
IO Threads
Event-handling in 1 Thread
Reduced waiting time
More concurrent requests possible
No synchronization necessary
Nodes approach
@dkhan
“Node.js ist Single Threaded”
@dkhan
calculateFibonacci();
@dkhan
Die Event Loop
@dkhan
Erste Schritte zu einer Node.js Applikation
@dkhan
Über 350.000 Module auf npm
@dkhan
@dkhan
@dkhan
@dkhan
@dkhan
@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:
@dkhan
@dkhan
If all you have is a hammer, everything looks like a nail
Abraham Maslow, 1966
@dkhan
Thank You! | Daniel Khan | @dkhan | [email protected]