SlideShare a Scribd company logo
Scalable JavaScript applications with 
Project Nashorn
Speakers 
Leonardo Zanivan 
Software Architect, Trier Sistemas 
github.com/panga 
@leonardopanga 
Michel Graciano 
Software Architect, Betha Sistemas 
github.com/mgraciano 
@mgraciano
Agenda 
โ— Why JS in the server 
โ— Why the JVM 
โ— Nashorn ecosystem 
โ— Vert.x and Avatar/Avatar.js 
โ— Q&A
Why JS in the server 
โ— Asynchronous by nature 
โ— Native JSON support 
โ— Language reuse 
โ— Easier developer transition
Why the JVM 
โ— Multilanguage 
โ— APM Tools 
โ— Access to the Java ecosystem 
o Domain models already implemented 
o Java EE 
o Core and third parties Java libraries
Nashorn 
โ— JDK 8 Compact 1 Profile with extension 
โ— Restrictions (browsers API, DOM) 
โ— No native CommonJS implementation 
โ— ECMA 5.1 + Rhino compatibility 
โ— jjs interactive command line tool
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Nashorn 
โ— JDK 8u20 
o JDK-8032068: sourceURL directives 
o JDK-8021350: Share script classes between 
threads/globals 
โ— JDK 8u40 
o JEP 196: Nashorn Optimistic Typing 
o JEP 202: Nashorn Class Filter 
o JEP 203: Initial ES6 implementation (const & let) 
โ— JEP 194: Nashorn Code Persistence (lazy compilation)
But how to scale it?
But how to scale it? 
Architectures and Technologies
Event-driven architecture 
โ— Event-loops 
โ— Async non-blocking IO 
โ— Reactive system 
โ— Event bus
Event-driven architecture
Microservice architecture 
โ— Focused on specific business 
โ— Well defined & distributed 
โ— Loosely coupled 
โ— Testable 
โ— Scalable
Microservices Architecture
Vert.x 
โ— http://vertx.io/ 
โ— Based on Netty 
โ— Sponsored by Red Hat 
โ— Winner of JAX Innovation Awards 2014 
@timfox: Writing Highly Concurrent Polyglot Applications with Vert.x 
[CON7902] Thursday, Oct 2, 11:30 AM
Vert.x 
โ— Key benefits 
o Polyglot 
o Event bus (async & worker verticles) 
o Create reactive applications 
o Microservices ready 
o Strong community involvement
Vert.x Architecture
Vert.x 
โ— Key benefits 
o Easy deployment 
๏‚ง CLI, API, mods, runtime deps resolution 
o Good build tools support (fat jar, auto-redeploy) 
o Native Cluster & HA with Hazelcast 
o Tons of extensions available
Vert.x 
โ— Challenges 
o Updated documentation 
o Verticle monitoring 
o Limited transactions support 
o Doesnโ€™t have distributed maps yet (2.x) 
o Nashorn debugging support (PR to be merged)
Vert.x 
โ— Vert.x 3 highlights 
o JDK 8+ with Nashorn & Lambda 
o No more module system* 
o Clustered shared data 
o Event bus proxies & codecs 
o Ext stack (MongoDB, SockJS, Route, Rx)
Demo 
โ— Real-time notification service using 
websockets over nashorn integrating with a 
legacy Java EE app
Avatar.js 
โ— https://avatar-js.java.net 
โ— Oracle sponsored 
โ— Focus on bringing the node programming 
model, APIs and module ecosystem to the 
Java platform
Avatar.js
Avatar 
โ— https://avatar.java.net 
โ— Oracle sponsored 
โ— Focus on Thin Server Architecture 
o Supports REST, WebSocket and Server-Sent 
Events 
โ— Built on Avatar.js
Avatar Architecture
Avatar EE Architecture
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Avatar 
โ— Deploying an application on Glassfish 4 
o asadmin deploy ~/projects/<app-folder-name> 
โ— Running the application 
o http://localhost:8080/<app-folder-name>
Avatar/Avatar.js 
โ— Key benefits 
o Avatar Services use an Actor-like concurrency 
model 
o NPM modules support 
o Strong Java EE integration 
o Debugging
Avatar/Avatar.js 
โ— Challenges 
o Weak community involvement 
o Low activity and no stable release 
o Glassfish / Weblogic only 
o Model Store API supports only Oracle NoSQL for 
schemaless database
Benchmark 
โ— Some simple and naive scenarios 
o Posting and querying from database 
o Returning a simple JSON response 
o String concatenation 
o Fibonacci calculation
Benchmark 
โ— Node.js 0.10.29 (2014-06-16) 
โ— Avatar.js 0.10.28-SNAPSHOT (2014-07-20) 
โ— Vert.X 2.1.1 (2014-06-18) 
โ— Avatar 1.0-ea-SNAPSHOT (2014-07-26) 
โ— JDK 8u5
Some Fib(30) results
Some Fib(30) results
Some Fib(30) results
Q&A
Credits 
โ— Event-loop & Vert.X architecture 
o Slideshare presentation http://bit.ly/1qz6KUb 
โ— Microservice architecture 
o http://martinfowler.com/articles/microservices.html 
โ— Avatar.js architecture 
o Project Avatar.js website 
โ— Avatar and Avatar EE architectures 
o Project Avatar website
Thank you! 
@leonardopanga 
@mgraciano 
โ— Sources 
o github.com/mgraciano/javaone-2014 
o github.com/panga/javaone2014-benchmarks

More Related Content

What's hot (20)

PDF
CompletableFuture ัƒะถะต ะทะดะตััŒ
Dmitry Chuyko
ย 
PPTX
Configuration for Java EE and the Cloud
Dmitry Kornilov
ย 
PDF
MySQL User Camp: GTIDs
Shivji Kumar Jha
ย 
PDF
JSONB introduction and comparison with other frameworks
Dmitry Kornilov
ย 
PDF
Node.js und die Oracle-Datenbank
Carsten Czarski
ย 
PDF
JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
ย 
PDF
MySQL Developer Day conference: MySQL Replication and Scalability
Shivji Kumar Jha
ย 
PDF
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
David Buck
ย 
PDF
Java EE 8 Overview (Japanese)
Logico
ย 
PDF
Open source India - MySQL Labs: Multi-Source Replication
Shivji Kumar Jha
ย 
PPTX
What's new in the Java API for JSON Binding
Dmitry Kornilov
ย 
PDF
Cloud Native Java:GraalVM
Taewan alvin Kim
ย 
PDF
MySQL User Camp: Multi-threaded Slaves
Shivji Kumar Jha
ย 
PDF
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
David Buck
ย 
PPTX
HotSpotใ‚ณใƒˆใƒใ‚ธใƒก
Yasumasa Suenaga
ย 
PPTX
Functional programming with_jdk8-s_ritter
Simon Ritter
ย 
PDF
Configuration beyond Java EE 8
Anatole Tresch
ย 
PDF
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
ย 
DOCX
Aneez Hasan_Resume
Aneez Hasan Mohamed Rafi
ย 
PDF
Intro To OSGi
Stephan Janssen
ย 
CompletableFuture ัƒะถะต ะทะดะตััŒ
Dmitry Chuyko
ย 
Configuration for Java EE and the Cloud
Dmitry Kornilov
ย 
MySQL User Camp: GTIDs
Shivji Kumar Jha
ย 
JSONB introduction and comparison with other frameworks
Dmitry Kornilov
ย 
Node.js und die Oracle-Datenbank
Carsten Czarski
ย 
JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
ย 
MySQL Developer Day conference: MySQL Replication and Scalability
Shivji Kumar Jha
ย 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
David Buck
ย 
Java EE 8 Overview (Japanese)
Logico
ย 
Open source India - MySQL Labs: Multi-Source Replication
Shivji Kumar Jha
ย 
What's new in the Java API for JSON Binding
Dmitry Kornilov
ย 
Cloud Native Java:GraalVM
Taewan alvin Kim
ย 
MySQL User Camp: Multi-threaded Slaves
Shivji Kumar Jha
ย 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
David Buck
ย 
HotSpotใ‚ณใƒˆใƒใ‚ธใƒก
Yasumasa Suenaga
ย 
Functional programming with_jdk8-s_ritter
Simon Ritter
ย 
Configuration beyond Java EE 8
Anatole Tresch
ย 
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
ย 
Aneez Hasan_Resume
Aneez Hasan Mohamed Rafi
ย 
Intro To OSGi
Stephan Janssen
ย 

Viewers also liked (15)

PPTX
NetBeans Day 2016 - Getting the best of NetBeans IDE
Leonardo Zanivan
ย 
PDF
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
Leonardo Zanivan
ย 
PDF
TDC 2016 - Rodando JavaScript Server com Wildfly
Leonardo Zanivan
ย 
PDF
TDC 2016 - Simplificando a seguranรงa de sua aplicaรงรฃo com Java EE
Leonardo Zanivan
ย 
PDF
O papel e a carreira do arquiteto de software
Leonardo Zanivan
ย 
PDF
Curso Android Bรกsico
Leonardo Zanivan
ย 
PPTX
React e reactividade Meetup Facebook Developer Circles
Josรฉ Barbosa
ย 
PDF
Curso de ReactJS
Gustavo Lopes
ย 
PDF
JavaOne 2015 - Simplificando a seguranรงa de sua aplicaรงรฃo com Java EE
Leonardo Zanivan
ย 
PDF
React + Flux (Alt)
Cezar Luiz
ย 
PDF
React Native na globo.com
Guilherme Heynemann Bruzzi
ย 
PDF
JavaOne 2016 - Kotlin: The Language of The Future For JVM?
Leonardo Zanivan
ย 
PPTX
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
ย 
PPTX
Vuejs Angularjs e Reactjs. Veja as diferenรงas de cada framework!
Josรฉ Barbosa
ย 
PDF
TDC 2014 - Arquitetura front-end com AngularJS
Leonardo Zanivan
ย 
NetBeans Day 2016 - Getting the best of NetBeans IDE
Leonardo Zanivan
ย 
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
Leonardo Zanivan
ย 
TDC 2016 - Rodando JavaScript Server com Wildfly
Leonardo Zanivan
ย 
TDC 2016 - Simplificando a seguranรงa de sua aplicaรงรฃo com Java EE
Leonardo Zanivan
ย 
O papel e a carreira do arquiteto de software
Leonardo Zanivan
ย 
Curso Android Bรกsico
Leonardo Zanivan
ย 
React e reactividade Meetup Facebook Developer Circles
Josรฉ Barbosa
ย 
Curso de ReactJS
Gustavo Lopes
ย 
JavaOne 2015 - Simplificando a seguranรงa de sua aplicaรงรฃo com Java EE
Leonardo Zanivan
ย 
React + Flux (Alt)
Cezar Luiz
ย 
React Native na globo.com
Guilherme Heynemann Bruzzi
ย 
JavaOne 2016 - Kotlin: The Language of The Future For JVM?
Leonardo Zanivan
ย 
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
ย 
Vuejs Angularjs e Reactjs. Veja as diferenรงas de cada framework!
Josรฉ Barbosa
ย 
TDC 2014 - Arquitetura front-end com AngularJS
Leonardo Zanivan
ย 
Ad

Similar to JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423] (20)

PDF
CON6423: Scalable JavaScript applications with Project Nashorn
Michel Graciano
ย 
PDF
Avatar 2.0
David Delabassee
ย 
PDF
Server Side JavaScript on the Java Platform - David Delabassee
JAXLondon2014
ย 
PDF
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
David Delabassee
ย 
PDF
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
David Delabassee
ย 
PDF
Avatar.js
Alin Pandichi
ย 
PDF
JavaOne 2010 Keynote
Tomoyuki Tatsuno
ย 
PDF
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Vitalij Zadneprovskij
ย 
PDF
Java keynote preso
Artur Alves
ย 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
ย 
PDF
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
ย 
PDF
Red Hat Java Update and Quarkus Introduction
John Archer
ย 
PDF
JavaOne 2014: Java vs JavaScript
Chris Bailey
ย 
ODP
Vert.x keynote for EclipseCon 2013
timfox111
ย 
PPTX
Java 8 Launch Event - Past, Present and Future of Java and Java 8 key themes
Lucas Jellema
ย 
PDF
Java8 launch at AMIS Services / First8
Getting value from IoT, Integration and Data Analytics
ย 
PDF
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
Chris Bailey
ย 
PPTX
Java8 launch AMIS Services by Lucas Jellema
Getting value from IoT, Integration and Data Analytics
ย 
PDF
Node.js an Exectutive View
Manuel Eusebio de Paz Carmona
ย 
PDF
Java vs. Java Script for enterprise web applications - Chris Bailey
JAXLondon_Conference
ย 
CON6423: Scalable JavaScript applications with Project Nashorn
Michel Graciano
ย 
Avatar 2.0
David Delabassee
ย 
Server Side JavaScript on the Java Platform - David Delabassee
JAXLondon2014
ย 
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
David Delabassee
ย 
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
David Delabassee
ย 
Avatar.js
Alin Pandichi
ย 
JavaOne 2010 Keynote
Tomoyuki Tatsuno
ย 
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Vitalij Zadneprovskij
ย 
Java keynote preso
Artur Alves
ย 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Jakarta_EE
ย 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
The Eclipse Foundation
ย 
Red Hat Java Update and Quarkus Introduction
John Archer
ย 
JavaOne 2014: Java vs JavaScript
Chris Bailey
ย 
Vert.x keynote for EclipseCon 2013
timfox111
ย 
Java 8 Launch Event - Past, Present and Future of Java and Java 8 key themes
Lucas Jellema
ย 
Java8 launch at AMIS Services / First8
Getting value from IoT, Integration and Data Analytics
ย 
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
Chris Bailey
ย 
Java8 launch AMIS Services by Lucas Jellema
Getting value from IoT, Integration and Data Analytics
ย 
Node.js an Exectutive View
Manuel Eusebio de Paz Carmona
ย 
Java vs. Java Script for enterprise web applications - Chris Bailey
JAXLondon_Conference
ย 
Ad

Recently uploaded (20)

PPTX
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
ย 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
ย 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
ย 
PPTX
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
ย 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
ย 
PPTX
For my supp to finally picking supp that work
necas19388
ย 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
ย 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
ย 
PDF
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
ย 
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
ย 
PPTX
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
ย 
PDF
Code Once; Run Everywhere - A Beginnerโ€™s Journey with React Native
Hasitha Walpola
ย 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
ย 
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
ย 
PPTX
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
ย 
PPTX
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
ย 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 
How Can Recruitment Management Software Improve Hiring Efficiency?
HireME
ย 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
ย 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
ย 
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
ย 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
ย 
For my supp to finally picking supp that work
necas19388
ย 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
ย 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
ย 
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
ย 
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
ย 
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
ย 
Code Once; Run Everywhere - A Beginnerโ€™s Journey with React Native
Hasitha Walpola
ย 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
ย 
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
ย 
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
ย 
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
ย 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
ย 

JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]

  • 1. Scalable JavaScript applications with Project Nashorn
  • 2. Speakers Leonardo Zanivan Software Architect, Trier Sistemas github.com/panga @leonardopanga Michel Graciano Software Architect, Betha Sistemas github.com/mgraciano @mgraciano
  • 3. Agenda โ— Why JS in the server โ— Why the JVM โ— Nashorn ecosystem โ— Vert.x and Avatar/Avatar.js โ— Q&A
  • 4. Why JS in the server โ— Asynchronous by nature โ— Native JSON support โ— Language reuse โ— Easier developer transition
  • 5. Why the JVM โ— Multilanguage โ— APM Tools โ— Access to the Java ecosystem o Domain models already implemented o Java EE o Core and third parties Java libraries
  • 6. Nashorn โ— JDK 8 Compact 1 Profile with extension โ— Restrictions (browsers API, DOM) โ— No native CommonJS implementation โ— ECMA 5.1 + Rhino compatibility โ— jjs interactive command line tool
  • 14. Nashorn โ— JDK 8u20 o JDK-8032068: sourceURL directives o JDK-8021350: Share script classes between threads/globals โ— JDK 8u40 o JEP 196: Nashorn Optimistic Typing o JEP 202: Nashorn Class Filter o JEP 203: Initial ES6 implementation (const & let) โ— JEP 194: Nashorn Code Persistence (lazy compilation)
  • 15. But how to scale it?
  • 16. But how to scale it? Architectures and Technologies
  • 17. Event-driven architecture โ— Event-loops โ— Async non-blocking IO โ— Reactive system โ— Event bus
  • 19. Microservice architecture โ— Focused on specific business โ— Well defined & distributed โ— Loosely coupled โ— Testable โ— Scalable
  • 21. Vert.x โ— http://vertx.io/ โ— Based on Netty โ— Sponsored by Red Hat โ— Winner of JAX Innovation Awards 2014 @timfox: Writing Highly Concurrent Polyglot Applications with Vert.x [CON7902] Thursday, Oct 2, 11:30 AM
  • 22. Vert.x โ— Key benefits o Polyglot o Event bus (async & worker verticles) o Create reactive applications o Microservices ready o Strong community involvement
  • 24. Vert.x โ— Key benefits o Easy deployment ๏‚ง CLI, API, mods, runtime deps resolution o Good build tools support (fat jar, auto-redeploy) o Native Cluster & HA with Hazelcast o Tons of extensions available
  • 25. Vert.x โ— Challenges o Updated documentation o Verticle monitoring o Limited transactions support o Doesnโ€™t have distributed maps yet (2.x) o Nashorn debugging support (PR to be merged)
  • 26. Vert.x โ— Vert.x 3 highlights o JDK 8+ with Nashorn & Lambda o No more module system* o Clustered shared data o Event bus proxies & codecs o Ext stack (MongoDB, SockJS, Route, Rx)
  • 27. Demo โ— Real-time notification service using websockets over nashorn integrating with a legacy Java EE app
  • 28. Avatar.js โ— https://avatar-js.java.net โ— Oracle sponsored โ— Focus on bringing the node programming model, APIs and module ecosystem to the Java platform
  • 30. Avatar โ— https://avatar.java.net โ— Oracle sponsored โ— Focus on Thin Server Architecture o Supports REST, WebSocket and Server-Sent Events โ— Built on Avatar.js
  • 35. Avatar โ— Deploying an application on Glassfish 4 o asadmin deploy ~/projects/<app-folder-name> โ— Running the application o http://localhost:8080/<app-folder-name>
  • 36. Avatar/Avatar.js โ— Key benefits o Avatar Services use an Actor-like concurrency model o NPM modules support o Strong Java EE integration o Debugging
  • 37. Avatar/Avatar.js โ— Challenges o Weak community involvement o Low activity and no stable release o Glassfish / Weblogic only o Model Store API supports only Oracle NoSQL for schemaless database
  • 38. Benchmark โ— Some simple and naive scenarios o Posting and querying from database o Returning a simple JSON response o String concatenation o Fibonacci calculation
  • 39. Benchmark โ— Node.js 0.10.29 (2014-06-16) โ— Avatar.js 0.10.28-SNAPSHOT (2014-07-20) โ— Vert.X 2.1.1 (2014-06-18) โ— Avatar 1.0-ea-SNAPSHOT (2014-07-26) โ— JDK 8u5
  • 43. Q&A
  • 44. Credits โ— Event-loop & Vert.X architecture o Slideshare presentation http://bit.ly/1qz6KUb โ— Microservice architecture o http://martinfowler.com/articles/microservices.html โ— Avatar.js architecture o Project Avatar.js website โ— Avatar and Avatar EE architectures o Project Avatar website
  • 45. Thank you! @leonardopanga @mgraciano โ— Sources o github.com/mgraciano/javaone-2014 o github.com/panga/javaone2014-benchmarks

Editor's Notes

  • #11: Michel IEEE 754
  • #12: Michel Aqui posso demonstrar manualmente no jjs os comandos, jjs rodando um script e ainda no NetBeans rodando um script .js direto do source .java.
  • #13: Michel Aqui posso demonstrar manualmente no jjs os comandos, jjs rodando um script e ainda no NetBeans rodando um script .js direto do source .java.
  • #14: Michel Here is time to show how to use some Java 8 features inside a JS script. Here is just the tip of the iceberg, since we can use not just the Stream API, but we can use all the Collectors, Java and Time and so on.
  • #15: Michel Here the focus is not the JEPs individually, IMHO here I should talk about the Nashorn evolution and focus that Oracle has done here. Basically, tell to the audience that this is a new technology and it has and will be improved constantly.
  • #16: Michel 12/13โ€™โ€™ It is just a transitory slide and should be fast. The point here is to link the architectures and technologies slides that will be presented. The focus will be that architectures make possible to use different kind of technologies in different services, allowing the environment where you can have not only Java, but other languages as JS. That said, Avatar and Vert.x should be quoted as candidates for this kind of scenario as will be presented next.
  • #17: Michel 12/13โ€™โ€™ It is just a transitory slide and should be fast. The point here is to link the architectures and technologies slides that will be presented. The focus will be that architectures make possible to use different kind of technologies in different services, allowing the environment where you can have not only Java, but other languages as JS. That said, Avatar and Vert.x should be quoted as candidates for this kind of scenario as will be presented next.
  • #18: Leonardo Before we start talking about those technologies, we must understand the concepts behind it. The first one is that event-driven architecture itโ€™s not much different than event-driven programming from desktop & mobile apps. The main concept are event-loops which runs in a single thread and handle requests to non blocking APIs or delegate long jobs to worker threads. Also you could have multiple event-loops in multiple threads. This kind of system is reactive, which means responsive, resilient, elastic and message driven. Responsive focus on providing faster and consistent response times, for better usability and user experience. Resilient remains responsive even after a failure with high availability and recovery. Elastic to maintain responsiveness with varying workloads with great scalability. Message driven to ensure loose coupling and asynchronous communication. In this scenario, the event bus is the mechanism to provide communication between nodes with different object models like a queue.
  • #19: Leonardo, 2/15โ€ Hereโ€™s how event-driven architecture looks like. Client requests goes to the event loop which delegate jobs to worker threads after callbacks to the event loop to finally response to the client This architecture is present in NodeJS and also Vert.x and Avatar (weโ€™ll talk about their soon) But unlike NodeJS, Vert.x and Avatar can have multi event loops and work well in cluster
  • #20: Leonardo Microservice architecture is the new buzzword of the SOA, but there isnโ€™t a precise definition Itโ€™s a new term, but most of the techniques are known, among the common characteristics are: Service focused on specific business logic, also could have small and separate development teams Itโ€™s well defined and independent from other services, can use polyglot programming language and polyglot persistence (like JavaScript and MongoDB) Loose coupled, only depends on services interfaces and contracts It is testable if you do it in the right way Easily scalable with commodity hardware and with IaaS/PaaS providers But, there are many challenges of this kind of architecture like: Complex management and deployment, plus requires DevOps skills and automation scripts It has the same complexity of a distributed system, so the recommendation is to use it when it makes sense
  • #29: Michel
  • #30: Michel
  • #31: Michel
  • #32: Michel
  • #33: Michel
  • #36: Michel, 15/50โ€™โ€™
  • #37: Michel
  • #38: Michel, O tรณpico dos problemas com node_modules foi um comentรกrio que eu fiz da dificuldade que eu tive de utilizar node_modules dentro do app, sรณ conseguir fazer com mรณdulos globais, APESAR de ter lido em algum lugar (que nรฃo lembro) que suportava dentro da aplicaรงรฃo, vale verificar ou remover isso da apresentaรงรฃo
  • #39: Michel Os benchmarks devem ser apresentados aqui. A dรบvida รฉ: vamos colocar isso antes ou depois do Demo?
  • #40: Michel Os benchmarks devem ser apresentados aqui. A dรบvida รฉ: vamos colocar isso antes ou depois do Demo?
  • #41: Michel
  • #42: Michel
  • #43: Michel, 5/55โ€™โ€™
  • #44: Leonardo Any questions?
  • #45: Leonardo Some credits from illustration
  • #46: Leonardo, 5/60โ€ Hereโ€™re our twitter handles, feel free to contact us or talk after this session. Also the source codes were published including full Vert.x demo application and Vert.x & Avatar benchmarks. Thank you!