SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
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 
○ Domain models already implemented 
○ Java EE 
○ 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
Nashorn 
● JDK 8u20 
○ JDK-8032068: sourceURL directives 
○ JDK-8021350: Share script classes between 
threads/globals 
● JDK 8u40 
○ JEP 196: Nashorn Optimistic Typing 
○ JEP 202: Nashorn Class Filter 
○ 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 
○ Polyglot 
○ Event bus (async & worker verticles) 
○ Create reactive applications 
○ Microservices ready 
○ Strong community involvement
Vert.x Architecture
Vert.x 
● Key benefits 
○ Easy deployment 
■ CLI, API, mods, runtime deps resolution 
○ Good build tools support (fat jar, auto-redeploy) 
○ Native Cluster & HA with Hazelcast 
○ Tons of extensions available
Vert.x 
● Challenges 
○ Updated documentation 
○ Verticle monitoring 
○ Limited transactions support 
○ Doesn’t have distributed maps yet (2.x) 
○ Nashorn debugging support (PR to be merged)
Vert.x 
● Vert.x 3 highlights 
○ JDK 8+ with Nashorn & Lambda 
○ No more module system* 
○ Clustered shared data 
○ Event bus proxies & codecs 
○ 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 
○ Supports REST, WebSocket and Server-Sent 
Events 
● Built on Avatar.js
Avatar Architecture
Avatar EE Architecture
Avatar 
● Deploying an application on Glassfish 4 
○ asadmin deploy ~/projects/<app-folder-name> 
● Running the application 
○ http://localhost:8080/<app-folder-name>
Avatar/Avatar.js 
● Key benefits 
○ Avatar Services use an Actor-like concurrency 
model 
○ NPM modules support 
○ Strong Java EE integration 
○ Debugging
Avatar/Avatar.js 
● Challenges 
○ Weak community involvement 
○ Low activity and no stable release 
○ Glassfish / Weblogic only 
○ Model Store API supports only Oracle NoSQL for 
schemaless database
Benchmark 
● Some simple and naive scenarios 
○ Posting and querying from database 
○ Returning a simple JSON response 
○ String concatenation 
○ 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 
○ Slideshare presentation http://bit.ly/1qz6KUb 
● Microservice architecture 
○ http://martinfowler.com/articles/microservices.html 
● Avatar.js architecture 
○ Project Avatar.js website 
● Avatar and Avatar EE architectures 
○ Project Avatar website
Thank you! 
@leonardopanga 
@mgraciano 
● Sources 
○ github.com/mgraciano/javaone-2014 
○ github.com/panga/javaone2014-benchmarks

Más contenido relacionado

La actualidad más candente

Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)Kaunas Java User Group
 
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupTiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupMorgan Tocker
 
blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformFabrizio Giudici
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXKai Donato
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1eddify
 
Introducing MagnetoDB, a key-value storage sevice for OpenStack
Introducing MagnetoDB, a key-value storage sevice for OpenStackIntroducing MagnetoDB, a key-value storage sevice for OpenStack
Introducing MagnetoDB, a key-value storage sevice for OpenStackMirantis
 
OSMC 2008 | Nagios Eventbroker Modules by Andreas Ericsson
OSMC 2008 | Nagios Eventbroker Modules by Andreas EricssonOSMC 2008 | Nagios Eventbroker Modules by Andreas Ericsson
OSMC 2008 | Nagios Eventbroker Modules by Andreas EricssonNETWAYS
 
Cloud Native and CNCF
Cloud Native and CNCFCloud Native and CNCF
Cloud Native and CNCFAkash Agrawal
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
Hashi talk israel
Hashi talk  israelHashi talk  israel
Hashi talk israelItaiTieger
 
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015AboutYouGmbH
 
Mage Titans - Magento 2 Frontend Framework - UI Components
Mage Titans - Magento 2 Frontend Framework - UI ComponentsMage Titans - Magento 2 Frontend Framework - UI Components
Mage Titans - Magento 2 Frontend Framework - UI Componentsvkorotun
 
How we build Videome
How we build VideomeHow we build Videome
How we build VideomeKane Zhu
 
MariaDB Encryption using AWS Key Management Service
MariaDB Encryption using AWS Key Management ServiceMariaDB Encryption using AWS Key Management Service
MariaDB Encryption using AWS Key Management ServiceHeinz Wiesinger
 
Kubernetes best practices.odf
Kubernetes best practices.odfKubernetes best practices.odf
Kubernetes best practices.odfAkash Agrawal
 
[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and Docker[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and DockerWSO2
 

La actualidad más candente (20)

Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
 
Node.js Test
Node.js TestNode.js Test
Node.js Test
 
TiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL MeetupTiDB Introduction - San Francisco MySQL Meetup
TiDB Introduction - San Francisco MySQL Meetup
 
blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans Platform
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEX
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
 
Introducing MagnetoDB, a key-value storage sevice for OpenStack
Introducing MagnetoDB, a key-value storage sevice for OpenStackIntroducing MagnetoDB, a key-value storage sevice for OpenStack
Introducing MagnetoDB, a key-value storage sevice for OpenStack
 
SFScon16 - Michele Baldessari: "OpenStack – An introduction"
SFScon16 - Michele Baldessari: "OpenStack – An introduction"SFScon16 - Michele Baldessari: "OpenStack – An introduction"
SFScon16 - Michele Baldessari: "OpenStack – An introduction"
 
OSMC 2008 | Nagios Eventbroker Modules by Andreas Ericsson
OSMC 2008 | Nagios Eventbroker Modules by Andreas EricssonOSMC 2008 | Nagios Eventbroker Modules by Andreas Ericsson
OSMC 2008 | Nagios Eventbroker Modules by Andreas Ericsson
 
Netflix Data Benchmark @ HPTS 2017
Netflix Data Benchmark @ HPTS 2017Netflix Data Benchmark @ HPTS 2017
Netflix Data Benchmark @ HPTS 2017
 
Cloud Native and CNCF
Cloud Native and CNCFCloud Native and CNCF
Cloud Native and CNCF
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
Hashi talk israel
Hashi talk  israelHashi talk  israel
Hashi talk israel
 
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
 
Mage Titans - Magento 2 Frontend Framework - UI Components
Mage Titans - Magento 2 Frontend Framework - UI ComponentsMage Titans - Magento 2 Frontend Framework - UI Components
Mage Titans - Magento 2 Frontend Framework - UI Components
 
oVirt – open your virtual datacenter
oVirt – open your virtual datacenteroVirt – open your virtual datacenter
oVirt – open your virtual datacenter
 
How we build Videome
How we build VideomeHow we build Videome
How we build Videome
 
MariaDB Encryption using AWS Key Management Service
MariaDB Encryption using AWS Key Management ServiceMariaDB Encryption using AWS Key Management Service
MariaDB Encryption using AWS Key Management Service
 
Kubernetes best practices.odf
Kubernetes best practices.odfKubernetes best practices.odf
Kubernetes best practices.odf
 
[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and Docker[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and Docker
 

Similar a Scalable JavaScript Apps with Project Nashorn & Vert.x

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]Leonardo Zanivan
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Restlet
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators Juraj Hantak
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchDataStax Academy
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenchesJohannes Rudolph
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015aspyker
 
20141111_SOS3_Gallo
20141111_SOS3_Gallo20141111_SOS3_Gallo
20141111_SOS3_GalloAndrea Gallo
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open SourceAll Things Open
 
Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Deepu K Sasidharan
 
Devoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipsterDevoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipsterJulien Dubois
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetesRafał Leszko
 

Similar a Scalable JavaScript Apps with Project Nashorn & Vert.x (20)

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]
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenches
 
Node.js scaling in highload
Node.js scaling in highloadNode.js scaling in highload
Node.js scaling in highload
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Netty training
Netty trainingNetty training
Netty training
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
20141111_SOS3_Gallo
20141111_SOS3_Gallo20141111_SOS3_Gallo
20141111_SOS3_Gallo
 
Netty training
Netty trainingNetty training
Netty training
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open Source
 
Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017
 
Devoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipsterDevoxx Belgium 2017 - easy microservices with JHipster
Devoxx Belgium 2017 - easy microservices with JHipster
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
 

Más de Michel Graciano

Aplicando CDI em aplicações Java
Aplicando CDI em aplicações JavaAplicando CDI em aplicações Java
Aplicando CDI em aplicações JavaMichel Graciano
 
O papel e a carreira de um desenvolvedor de software
O papel e a carreira de um desenvolvedor de softwareO papel e a carreira de um desenvolvedor de software
O papel e a carreira de um desenvolvedor de softwareMichel Graciano
 
Finalmente java sabe trabalhar com data e hora (gu java sc)
Finalmente java sabe trabalhar com data e hora (gu java sc)Finalmente java sabe trabalhar com data e hora (gu java sc)
Finalmente java sabe trabalhar com data e hora (gu java sc)Michel Graciano
 
Finalmente java sabe trabalhar com data e hora
Finalmente java sabe trabalhar com data e horaFinalmente java sabe trabalhar com data e hora
Finalmente java sabe trabalhar com data e horaMichel Graciano
 
Designing Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDIDesigning Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDIMichel Graciano
 
Introdução a CDI e como utilizá-la em aplicações reais
Introdução a CDI e como utilizá-la em aplicações reaisIntrodução a CDI e como utilizá-la em aplicações reais
Introdução a CDI e como utilizá-la em aplicações reaisMichel Graciano
 
genesis - Acelerando o desenvolvimento de aplicações desktop
genesis - Acelerando o desenvolvimento de aplicações desktopgenesis - Acelerando o desenvolvimento de aplicações desktop
genesis - Acelerando o desenvolvimento de aplicações desktopMichel Graciano
 

Más de Michel Graciano (7)

Aplicando CDI em aplicações Java
Aplicando CDI em aplicações JavaAplicando CDI em aplicações Java
Aplicando CDI em aplicações Java
 
O papel e a carreira de um desenvolvedor de software
O papel e a carreira de um desenvolvedor de softwareO papel e a carreira de um desenvolvedor de software
O papel e a carreira de um desenvolvedor de software
 
Finalmente java sabe trabalhar com data e hora (gu java sc)
Finalmente java sabe trabalhar com data e hora (gu java sc)Finalmente java sabe trabalhar com data e hora (gu java sc)
Finalmente java sabe trabalhar com data e hora (gu java sc)
 
Finalmente java sabe trabalhar com data e hora
Finalmente java sabe trabalhar com data e horaFinalmente java sabe trabalhar com data e hora
Finalmente java sabe trabalhar com data e hora
 
Designing Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDIDesigning Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDI
 
Introdução a CDI e como utilizá-la em aplicações reais
Introdução a CDI e como utilizá-la em aplicações reaisIntrodução a CDI e como utilizá-la em aplicações reais
Introdução a CDI e como utilizá-la em aplicações reais
 
genesis - Acelerando o desenvolvimento de aplicações desktop
genesis - Acelerando o desenvolvimento de aplicações desktopgenesis - Acelerando o desenvolvimento de aplicações desktop
genesis - Acelerando o desenvolvimento de aplicações desktop
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Scalable JavaScript Apps with Project Nashorn & Vert.x

  • 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 ○ Domain models already implemented ○ Java EE ○ 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
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Nashorn ● JDK 8u20 ○ JDK-8032068: sourceURL directives ○ JDK-8021350: Share script classes between threads/globals ● JDK 8u40 ○ JEP 196: Nashorn Optimistic Typing ○ JEP 202: Nashorn Class Filter ○ 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 ○ Polyglot ○ Event bus (async & worker verticles) ○ Create reactive applications ○ Microservices ready ○ Strong community involvement
  • 24. Vert.x ● Key benefits ○ Easy deployment ■ CLI, API, mods, runtime deps resolution ○ Good build tools support (fat jar, auto-redeploy) ○ Native Cluster & HA with Hazelcast ○ Tons of extensions available
  • 25. Vert.x ● Challenges ○ Updated documentation ○ Verticle monitoring ○ Limited transactions support ○ Doesn’t have distributed maps yet (2.x) ○ Nashorn debugging support (PR to be merged)
  • 26. Vert.x ● Vert.x 3 highlights ○ JDK 8+ with Nashorn & Lambda ○ No more module system* ○ Clustered shared data ○ Event bus proxies & codecs ○ 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 ○ Supports REST, WebSocket and Server-Sent Events ● Built on Avatar.js
  • 33.
  • 34.
  • 35. Avatar ● Deploying an application on Glassfish 4 ○ asadmin deploy ~/projects/<app-folder-name> ● Running the application ○ http://localhost:8080/<app-folder-name>
  • 36. Avatar/Avatar.js ● Key benefits ○ Avatar Services use an Actor-like concurrency model ○ NPM modules support ○ Strong Java EE integration ○ Debugging
  • 37. Avatar/Avatar.js ● Challenges ○ Weak community involvement ○ Low activity and no stable release ○ Glassfish / Weblogic only ○ Model Store API supports only Oracle NoSQL for schemaless database
  • 38. Benchmark ● Some simple and naive scenarios ○ Posting and querying from database ○ Returning a simple JSON response ○ String concatenation ○ 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 ○ Slideshare presentation http://bit.ly/1qz6KUb ● Microservice architecture ○ http://martinfowler.com/articles/microservices.html ● Avatar.js architecture ○ Project Avatar.js website ● Avatar and Avatar EE architectures ○ Project Avatar website
  • 45. Thank you! @leonardopanga @mgraciano ● Sources ○ github.com/mgraciano/javaone-2014 ○ github.com/panga/javaone2014-benchmarks