SlideShare a Scribd company logo
1 of 23
Vert.x - Polyglot
Asynchronous Applications

          Tim Fox
       Vert.x Project Lead
             Red Hat
          @timfox
What is Vert.x?
 ■ General purpose application platform
 ■ Superficially similar to Node.js – but not a clone!
 ■ Asynchronous APIs
 ■ Polyglot – mix and match Java, JavaScript/CoffeeScript, Ruby, Groovy and
   Python (others to follow).
 ■ Simple but not Simplistic
 ■ Part of the new breed of application platforms
Project Info
 ■   Independent Community Project
 ■   Hopefully moving to the Eclipse Foundation soon!
 ■   100% open source (ASL 2.0 + Creative Commons)
 ■   9th most watched Java project on github
     https://github.com/languages/Java/most_watched
Core APIs
 ■   TCP/SSL clients and servers
 ■   HTTP/HTTPS clients and servers – including WebSockets
 ■   File system
 ■   Event bus
 ■   100% asynchronous
 ■   Don't call us, we'll call you!
Core APIs
 ■   TCP/SSL clients and servers
 ■   HTTP/HTTPS clients and servers – including WebSockets
 ■   File system
 ■   Event bus
 ■   100% asynchronous
 ■   Don't call us, we'll call you!
Basic web-server (JavaScript)

 load('vertx.js')


 vertx.createHttpServer().requestHandler(function(req) {
     var file = req.path === '/' ? 'index.html' : req.path
     req.response.sendFile(file)
 }).listen(8080)
Why Asynchronous?

 ■ Many long lived connections are a feature of modern applications –
   Websockets, MQTT
 ■ OS threads are still a precious resource
 ■ Need to service many connections with small number of threads
 ■ Blocked OS threads means they can't do other work
 ■ But async APIs suck, right?
 ■ Use promises library like     to “Flatten the Pyramid of Doom”
Threading model

 ■   Vert.x implements the Multi-Reactor Pattern
 ■   An event loop is an OS thread
 ■   Handles events for many handlers
 ■   Vert.x has multiple event loops. Typically one per core.
 ■   Don't block the event loop!
Hybrid Threading Model
 ■   Don't force everything to run on an event loop
 ■   Worker verticles can block
 ■   Communicate with other verticles by message passing.
 ■   Allows us to leverage the huge ecosystem of blocking Java libs
Concurrency
 ■   Vert.x components are single-threaded.
 ■   “Actor-style” concurrency.
 ■   Move away from 'Java-style' multi-threaded concurrency
 ■   No more synchronized, volatile or locking
 ■   Wave goodbye to many race conditions
Event Bus
 ■   The nervous system of Vert.x
 ■   Verticles communicate using the event bus.
 ■   Super simple API.
 ■   Point to point. Publish/Subscribe. Request/Response.
 ■   Pass simple strings, numbers or other primitive types.
 ■   JSON messages are preferred for structured data.
Event bus code example
 var handler = function(message) {
     console.log('Received message ' + message.msg)
 }
 vertx.eventBus.registerHandler('example.address', handler)

 vertx.setPeriodic(1000, function() {
     vertx.eventBus.send('example.address', {msg:'foo'})
 })
Distributed Event Bus
 ■ Connects multiple Vert.x JVM instances
 ■ Forms a large distributed event space
 ■ Applications are loosely coupled components distributed across your
   network
Extend the Event Bus to the Browser
 ■   Event bus extends to client side JavaScript too
 ■   Uses the same API on the client
 ■   Powerful distributed event space spanning both client and server nodes
 ■   Ideal for modern “real-time” web applications
Module system
 ■ Verticles can be packaged into re-usable packages called modules
 ■ Modules can contain code in any of the Vert.x languages
 ■ Modules can live in the “usual” places. (Vert.x 2.0 - Maven Central, Nexus,
   etc)
 ■ Encourage an eco-system of Vert.x modules.
 ■ Empower the community
 ■ Keep the core project compact.
Examples of modules
 ■   JDBC
 ■   MongoDB
 ■   Redis
 ■   AMQP
 ■   Mailer
 ■   Work queues
 ■   Session Manager
 ■   Web framework
 ■   Rhino, DynJS, Groovy, JRuby, Jython, Scala, Clojure, etc
Easy Developer Experience
 Vert.x 2.0:
  ■ Gradle template project
  ■ Maven archetype and plugins
  ■ Zero setup IDE debugging
  ■ Zero setup IDE testing
Introducing DynJS
 ■ New 100% InvokeDynamic JavaScript implementation for the JVM
 ■ Authors part of same polyglot team at Red Hat
 ■ DynJS language module for Vert.x
Node.js Compatibility
 ■ Run Node.js apps on Vert.x
 ■ Node.js support using DynJS
 ■ Migration path to Vert.x




                     + V8        Vert.x +
Summary
 ■   Write apps as set of loosely coupled components that live anywhere
 ■   Polyglot – use the language(s) you want
 ■   Simple concurrency – wave goodbye to most race conditions
 ■   Leverage existing Java library ecosystem
 ■   Module system – empower the community
 ■   Run Node.js apps too

     We believe Vert.x is the platform for the new generation of polyglot web and
                                 enterprise applications
Summary
 ■   Write apps as set of loosely coupled components that live anywhere
 ■   Polyglot – use the language(s) you want
 ■   Simple concurrency – wave goodbye to most race conditions
 ■   Leverage existing Java library ecosystem
 ■   Module system – empower the community
 ■   Run Node.js apps too

     We believe Vert.x is the platform for the new generation of polyglot web and
                                 enterprise applications
Get involved!
 ■   Loads more to do
 ■   Very small team!
 ■   Github: https://github.com/vert-x/vert.x
 ■   Google group: vertx
 ■   IRC channel: #vertx on freenode.net
Q&A
 https://github.com/vert-x/vert.x

 http://vertx.io/

More Related Content

What's hot

Creating polyglot and scalable applications on the jvm using Vert.x
Creating polyglot and scalable applications on the jvm using Vert.xCreating polyglot and scalable applications on the jvm using Vert.x
Creating polyglot and scalable applications on the jvm using Vert.xJettro Coenradie
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAlex Thissen
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesBart Spaans
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?Ovidiu Dimulescu
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
 
Fabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymoreFabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymoreHenryk Konsek
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appBASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appHanaStevanovic
 
Building Micro-Services with Scala
Building Micro-Services with ScalaBuilding Micro-Services with Scala
Building Micro-Services with ScalaYardena Meymann
 
CloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesCloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesSebastien Goasguen
 
OSv – The OS designed for the Cloud
OSv – The OS designed for the CloudOSv – The OS designed for the Cloud
OSv – The OS designed for the CloudYandex
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)roland.huss
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners openstackindia
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in LispVladimir Sedach
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web FrameworksJoe Kutner
 
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017Codemotion
 

What's hot (20)

Creating polyglot and scalable applications on the jvm using Vert.x
Creating polyglot and scalable applications on the jvm using Vert.xCreating polyglot and scalable applications on the jvm using Vert.x
Creating polyglot and scalable applications on the jvm using Vert.x
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NET
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for Kubernetes
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 
Fabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymoreFabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymore
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appBASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
 
Building Micro-Services with Scala
Building Micro-Services with ScalaBuilding Micro-Services with Scala
Building Micro-Services with Scala
 
CloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use CasesCloudStack Conference Public Clouds Use Cases
CloudStack Conference Public Clouds Use Cases
 
OSv – The OS designed for the Cloud
OSv – The OS designed for the CloudOSv – The OS designed for the Cloud
OSv – The OS designed for the Cloud
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners
 
Container orchestration
Container orchestrationContainer orchestration
Container orchestration
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
 

Similar to Vert.x keynote for EclipseCon 2013

Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...jaxLondonConference
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami SayarFITC
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101Rami Sayar
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANJeff Fox
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...NETWAYS
 
Node.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNode.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNaveen S.R
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJsAram Rafeq
 
Node js Development Company - Aparajayah
Node js Development Company - AparajayahNode js Development Company - Aparajayah
Node js Development Company - AparajayahAparajayahTechnologi
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sailsBrian Shannon
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS drupalcampest
 

Similar to Vert.x keynote for EclipseCon 2013 (20)

Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
 
Nodejs
NodejsNodejs
Nodejs
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
World of Node.JS
World of Node.JSWorld of Node.JS
World of Node.JS
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
Exploring Node.jS
Exploring Node.jSExploring Node.jS
Exploring Node.jS
 
Node.js Chapter1
Node.js Chapter1Node.js Chapter1
Node.js Chapter1
 
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
 
Node.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNode.js In The Enterprise - A Primer
Node.js In The Enterprise - A Primer
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
 
Node js Development Company - Aparajayah
Node js Development Company - AparajayahNode js Development Company - Aparajayah
Node js Development Company - Aparajayah
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
 
Node js internal
Node js internalNode js internal
Node js internal
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 

Vert.x keynote for EclipseCon 2013

  • 1. Vert.x - Polyglot Asynchronous Applications Tim Fox Vert.x Project Lead Red Hat @timfox
  • 2. What is Vert.x? ■ General purpose application platform ■ Superficially similar to Node.js – but not a clone! ■ Asynchronous APIs ■ Polyglot – mix and match Java, JavaScript/CoffeeScript, Ruby, Groovy and Python (others to follow). ■ Simple but not Simplistic ■ Part of the new breed of application platforms
  • 3. Project Info ■ Independent Community Project ■ Hopefully moving to the Eclipse Foundation soon! ■ 100% open source (ASL 2.0 + Creative Commons) ■ 9th most watched Java project on github https://github.com/languages/Java/most_watched
  • 4. Core APIs ■ TCP/SSL clients and servers ■ HTTP/HTTPS clients and servers – including WebSockets ■ File system ■ Event bus ■ 100% asynchronous ■ Don't call us, we'll call you!
  • 5. Core APIs ■ TCP/SSL clients and servers ■ HTTP/HTTPS clients and servers – including WebSockets ■ File system ■ Event bus ■ 100% asynchronous ■ Don't call us, we'll call you!
  • 6. Basic web-server (JavaScript) load('vertx.js') vertx.createHttpServer().requestHandler(function(req) { var file = req.path === '/' ? 'index.html' : req.path req.response.sendFile(file) }).listen(8080)
  • 7. Why Asynchronous? ■ Many long lived connections are a feature of modern applications – Websockets, MQTT ■ OS threads are still a precious resource ■ Need to service many connections with small number of threads ■ Blocked OS threads means they can't do other work ■ But async APIs suck, right? ■ Use promises library like to “Flatten the Pyramid of Doom”
  • 8. Threading model ■ Vert.x implements the Multi-Reactor Pattern ■ An event loop is an OS thread ■ Handles events for many handlers ■ Vert.x has multiple event loops. Typically one per core. ■ Don't block the event loop!
  • 9. Hybrid Threading Model ■ Don't force everything to run on an event loop ■ Worker verticles can block ■ Communicate with other verticles by message passing. ■ Allows us to leverage the huge ecosystem of blocking Java libs
  • 10. Concurrency ■ Vert.x components are single-threaded. ■ “Actor-style” concurrency. ■ Move away from 'Java-style' multi-threaded concurrency ■ No more synchronized, volatile or locking ■ Wave goodbye to many race conditions
  • 11. Event Bus ■ The nervous system of Vert.x ■ Verticles communicate using the event bus. ■ Super simple API. ■ Point to point. Publish/Subscribe. Request/Response. ■ Pass simple strings, numbers or other primitive types. ■ JSON messages are preferred for structured data.
  • 12. Event bus code example var handler = function(message) { console.log('Received message ' + message.msg) } vertx.eventBus.registerHandler('example.address', handler) vertx.setPeriodic(1000, function() { vertx.eventBus.send('example.address', {msg:'foo'}) })
  • 13. Distributed Event Bus ■ Connects multiple Vert.x JVM instances ■ Forms a large distributed event space ■ Applications are loosely coupled components distributed across your network
  • 14. Extend the Event Bus to the Browser ■ Event bus extends to client side JavaScript too ■ Uses the same API on the client ■ Powerful distributed event space spanning both client and server nodes ■ Ideal for modern “real-time” web applications
  • 15. Module system ■ Verticles can be packaged into re-usable packages called modules ■ Modules can contain code in any of the Vert.x languages ■ Modules can live in the “usual” places. (Vert.x 2.0 - Maven Central, Nexus, etc) ■ Encourage an eco-system of Vert.x modules. ■ Empower the community ■ Keep the core project compact.
  • 16. Examples of modules ■ JDBC ■ MongoDB ■ Redis ■ AMQP ■ Mailer ■ Work queues ■ Session Manager ■ Web framework ■ Rhino, DynJS, Groovy, JRuby, Jython, Scala, Clojure, etc
  • 17. Easy Developer Experience Vert.x 2.0: ■ Gradle template project ■ Maven archetype and plugins ■ Zero setup IDE debugging ■ Zero setup IDE testing
  • 18. Introducing DynJS ■ New 100% InvokeDynamic JavaScript implementation for the JVM ■ Authors part of same polyglot team at Red Hat ■ DynJS language module for Vert.x
  • 19. Node.js Compatibility ■ Run Node.js apps on Vert.x ■ Node.js support using DynJS ■ Migration path to Vert.x + V8 Vert.x +
  • 20. Summary ■ Write apps as set of loosely coupled components that live anywhere ■ Polyglot – use the language(s) you want ■ Simple concurrency – wave goodbye to most race conditions ■ Leverage existing Java library ecosystem ■ Module system – empower the community ■ Run Node.js apps too We believe Vert.x is the platform for the new generation of polyglot web and enterprise applications
  • 21. Summary ■ Write apps as set of loosely coupled components that live anywhere ■ Polyglot – use the language(s) you want ■ Simple concurrency – wave goodbye to most race conditions ■ Leverage existing Java library ecosystem ■ Module system – empower the community ■ Run Node.js apps too We believe Vert.x is the platform for the new generation of polyglot web and enterprise applications
  • 22. Get involved! ■ Loads more to do ■ Very small team! ■ Github: https://github.com/vert-x/vert.x ■ Google group: vertx ■ IRC channel: #vertx on freenode.net