SlideShare una empresa de Scribd logo
1 de 40
vert.x
asynchronous applications
       + big data

    Pid – Stuart Williams
      Consulting Architect
        SpringSource

          @pidster
Pid (Stuart Williams)
  Speaker Bio
  ■ Consulting Architect at SpringSource / Pivotal
    Application architecture, performance (and hand-waving)

  ■ Projects                         ■ Communities
   ■ vert.x                           ■ Apache Tomcat
   ■ Apache Oltu (OAuth)              ■ Groovy




                                                              3
vert.x project
 Project Lead
   @timfox

 Committers
   @pidster
   @normanm (netty)




                      4
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




                                                                        5
Key Features
 Hybrid Reactor
 Polyglot Container
 TCP/SSL clients and servers
 HTTP/HTTPS clients and servers – including WebSockets
 File system
 Event bus
 100% asynchronous




                                                         6
Code!
 Super simple HTTP server
 Serves files by matching request path
 One example for each language




                                         7
JavaScript – Mozilla Rhino
 load('vertx.js’)

 vertx.createHttpServer().requestHandler(function(req) {

   var file = req.path === '/' ? 'index.html' : req.path;
   req.response.sendFile('webroot/' + file);

 }).listen(8080)

                                                            8
Python – www.jython.org
 import vertx

 server = vertx.create_http_server()
 @server.request_handler

 def request_handler(req):
   file = "index.html" if req.uri == "/" else req.uri
   req.response.send_file("webroot/%s"%file)
 server.listen(8080)
                                                        9
Ruby – jruby.org
 require "vertx"

 Vertx::HttpServer.new.request_handler do |req|

   file = req.uri == "/" ? "index.html" : req.uri
   req.response.send_file "webroot/#{file}”

 end.listen(8080)

                                                    10
Groovy – groovy-lang.org
 vertx.createHttpServer().requestHandler { req ->

   def file = req.uri == "/" ? "index.html" : req.uri
   req.response.sendFile "webroot/$file”

 }.listen(8080)




                                                        11
Java
 import org.vertx.java.core.Handler;
 import org.vertx.java.core.http.HttpServerRequest;
 import org.vertx.java.deploy.Verticle;


 public class Server extends Verticle {
     public void start() {
         vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
           public void handle(HttpServerRequest req) {
               String file = req.path.equals("/") ? "index.html" : req.path;
               req.response.sendFile("webroot/" + file);
           }
         }).listen(8080);
     }
 }
                                                                                      12
Scala – soon!
 vertx.createHttpServer
  .requestHandler { req: HttpServerRequest =>

   val file : String = if (req.path == “/”) “/index.html” else req.uri
   req.response.sendFile("webroot/" + file)

 } .listen(8080)



                                                                         13
More languages?
 DynJS
   100% InvokeDynamic
   Alternative to Rhino for JavaScript
   Node.js Compatibility for vert.x

 Clojure?

 What language support do you want see?

                                          14
Thread Pools
 Non-blocking Event Loops
   Core Loop
   Acceptors

 Blocking
   Worker Pool




                            15
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!




                                                                16
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




                                                                    17
Components
 Server & Client
   TCP
   HTTP
    WebSocket
    SockJS
 Event Bus
   Point-to-point, publish-subscribe
   Transparent clustering

                                       18
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.
 Transparent clustering



                                                          19
Event Bus – 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’ })
 })
                                                              20
Event Bus – Extended to 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



                                                                 21
Modules
 Authentication Manager   ■   Web Server
 Form Upload              ■   Work Queue
 JDBC Persistor           ■   AMQP
 Mailer                   ■   More…
 Mongo Persistor
 Session Manager



                                            22
mod-web-server
 load('vertx.js’)
 var config = {
       "web_root": <web_root>,
       "port", <port>,
       "ssl": <ssl>,
       "key_store_password": <key_store_password>,
       "key_store_path": <key_store_path>,
 }
 vertx.deployModule('vertx.web-server-v1.0', config, 1, function() {
     // deployed
 });
                                                                       23
Composition
 Deploy code using code
 Modules are unit of composed code
 Deploy modules using a verticle
 Or provide multiple verticles inside a module
 Remember: verticles communicate using the Event Bus.




                                                        24
Architecture

                      I/O verticles
                                              Logic
                                              verticles
 Separation of concerns
 Workers if required                  Event
                                       Bus
 Polyglot

                                              Worker
                                              verticle

                                                          25
Example
 ….




          26
Big Fast Data
 Realtime Analytics Dashboards & APIs
   WebSocket
   SockJS

 Polyglot Integration
   Use language independent format like JSON, XML for data
   Exchange messages using event bus



                                                             27
Fast Data – RabbitMQ
 AMQP message broker

 Use for queuing, routing messages and WAN clustering




                                                        28
Big/Fast Data – Redis
 “Data Structure Server”
 Key-Value store
 Pub-sub messaging

 Use for caching verticle data, broadcasting to verticles




                                                            29
Big/Fast Data – GemFire
 Compute Grid / Distributed Cache
 Embeddable Key-Value store

 Use for large partitioned caches, high performance compute,
   WANs
 Send data to vert.x using CacheListeners, subscriptions,
   AsyncQueues



                                                               30
Big Data – Hadoop
 Hive – of course!
 SQL queries via JDBC worker verticle
 Standard pattern via event bus

 Use for ad-hoc queries on large datasets




                                            31
Big Data – MQTT
    MQTT is a machine-to-machine (M2M) / "Internet of Things”
     connectivity protocol.
    Extremely lightweight publish/subscribe messaging transport.
    It is useful for connections with remote locations where a small
     code footprint is required and/or network bandwidth is at a
     premium.
    Eclipse Paho

 Coming soon!
                                                                        32
Big Data – Intravert (@zznate - apigee)
  Processors, filters and procedures allow you perform arbitrary
   programmatic transformations on the server side before the results are
   returned to the client.
  Execute procedures and join like logic in a single RPC request
   eliminating round-trips
  A simple transport and JSON API that runs over HTTP allows clients to
   choose from JSON, JSON compressed by smile, & even big fat sexy
   XML
  A real REST interface (ever thought about what would a Cassandra
   hyper media API look like?)
  Work with simple familiar objects like String or Integer instead of bytes
                                                                               33
v2.0 – Features
    New ClassLoader
    Netty 4.0
    Languages as modules
    Flexible Module repositories, including Maven
    Management




                                                     34
v2.0 – Developer experience
    Gradle template project
    Maven archetype and plugins
    Zero setup IDE debugging
    Zero setup IDE testing
    Test Tools project




                                   35
Management
 Management Agent
   Publishes metrics on Event Bus in JSON format
 Management GUI
 JMX Demo




                                                   36
Real Deployment
 vert.x provides a JSON RPC API:

     deployer.js
      JsonRpcServer.groovy
      Integration.groovy – worker
        Spring Integration message flow to RabbitMQ
         Dynamically deploys components to consume queues:
          Consumer.groovy – worker, Spring Integration message flow
          JsonRpcClient.groovy
                                                                       37
Real Deployment
      I/O verticles           Worker Verticles

        HTTP                  Spring Integration
      JSON RPC                AMQP publisher


                      Event
                       Bus


        HTTP                  Spring Integration (Groovy DSL)
    JSON RPC Client           AMQP Consumer


                                          38
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                     39
Q&A

Más contenido relacionado

La actualidad más candente

Vert.x introduction
Vert.x introductionVert.x introduction
Vert.x introductionGR8Conf
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xSascha Möllering
 
Vert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMVert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMMassimiliano Dessì
 
vert.x - life beyond jetty and apache
vert.x - life beyond jetty and apachevert.x - life beyond jetty and apache
vert.x - life beyond jetty and apacheRalph Winzinger
 
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
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015Nir Noy
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaNurul Ferdous
 
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
 
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
 
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
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionOvidiu Dimulescu
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesBart Spaans
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 

La actualidad más candente (20)

Vert.x introduction
Vert.x introductionVert.x introduction
Vert.x introduction
 
Vertx
VertxVertx
Vertx
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Vert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMVert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVM
 
vert.x - life beyond jetty and apache
vert.x - life beyond jetty and apachevert.x - life beyond jetty and apache
vert.x - life beyond jetty and apache
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
 
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 ...
 
Vert.x vs akka
Vert.x vs akkaVert.x vs akka
Vert.x vs akka
 
Node js internal
Node js internalNode js internal
Node js internal
 
Node.js code tracing
Node.js code tracingNode.js code tracing
Node.js code tracing
 
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)
 
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
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Container orchestration
Container orchestrationContainer orchestration
Container orchestration
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
KubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for KubernetesKubeFuse - A File-System for Kubernetes
KubeFuse - A File-System for Kubernetes
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 

Destacado

Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data bindingVert.x – The problem of real-time data binding
Vert.x – The problem of real-time data bindingAlex Derkach
 
ABB Semiconductors Newsletter - March 2014
ABB Semiconductors Newsletter - March 2014ABB Semiconductors Newsletter - March 2014
ABB Semiconductors Newsletter - March 2014Siegfried Quemado
 
กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3Naphatsorn Keadmongkol
 
กิจกรรมที่ 5ข้อ 2
กิจกรรมที่ 5ข้อ 2กิจกรรมที่ 5ข้อ 2
กิจกรรมที่ 5ข้อ 2Naphatsorn Keadmongkol
 
กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3Naphatsorn Keadmongkol
 
กิจกรรมที่ 5 ข้อ1
กิจกรรมที่ 5 ข้อ1กิจกรรมที่ 5 ข้อ1
กิจกรรมที่ 5 ข้อ1Naphatsorn Keadmongkol
 
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app... 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...Anna Shymchenko
 
Questions within questions and questions within statements
Questions within questions and questions within statementsQuestions within questions and questions within statements
Questions within questions and questions within statementsMaria Del Mar Arciniegas
 
Light peak presentation
Light peak presentationLight peak presentation
Light peak presentationSimer Sahni
 
Vert.x using Groovy - Simplifying non-blocking code
Vert.x using Groovy - Simplifying non-blocking codeVert.x using Groovy - Simplifying non-blocking code
Vert.x using Groovy - Simplifying non-blocking codesascha_klein
 
Case studies of mobile device usage
Case studies of mobile device usageCase studies of mobile device usage
Case studies of mobile device usageKosie Eloff
 
Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Agraj Mangal
 

Destacado (20)

Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data bindingVert.x – The problem of real-time data binding
Vert.x – The problem of real-time data binding
 
ABB Semiconductors Newsletter - March 2014
ABB Semiconductors Newsletter - March 2014ABB Semiconductors Newsletter - March 2014
ABB Semiconductors Newsletter - March 2014
 
กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3
 
Datail1
Datail1Datail1
Datail1
 
กิจกรรมที่ 5ข้อ 2
กิจกรรมที่ 5ข้อ 2กิจกรรมที่ 5ข้อ 2
กิจกรรมที่ 5ข้อ 2
 
กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3กิจกรรมที่ 5ข้อ 3
กิจกรรมที่ 5ข้อ 3
 
Phrasal verbs
Phrasal verbsPhrasal verbs
Phrasal verbs
 
Unites 6 and 7
Unites 6 and 7Unites 6 and 7
Unites 6 and 7
 
กิจกรรมที่ 5 ข้อ1
กิจกรรมที่ 5 ข้อ1กิจกรรมที่ 5 ข้อ1
กิจกรรมที่ 5 ข้อ1
 
Detail2
Detail2Detail2
Detail2
 
Detail3
Detail3Detail3
Detail3
 
Wishes and imaginary situations or events
Wishes and imaginary situations or eventsWishes and imaginary situations or events
Wishes and imaginary situations or events
 
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app... 	Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
 
Questions within questions and questions within statements
Questions within questions and questions within statementsQuestions within questions and questions within statements
Questions within questions and questions within statements
 
Vert.x
Vert.xVert.x
Vert.x
 
Light peak presentation
Light peak presentationLight peak presentation
Light peak presentation
 
Vert.x using Groovy - Simplifying non-blocking code
Vert.x using Groovy - Simplifying non-blocking codeVert.x using Groovy - Simplifying non-blocking code
Vert.x using Groovy - Simplifying non-blocking code
 
Vert.x 3
Vert.x 3Vert.x 3
Vert.x 3
 
Case studies of mobile device usage
Case studies of mobile device usageCase studies of mobile device usage
Case studies of mobile device usage
 
Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Building microservices with vert.x 3.0
Building microservices with vert.x 3.0
 

Similar a Vert.x devoxx london 2013

StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationBKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationLinaro
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your wayJohannes Brännström
 
Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?glynnormington
 
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
 
Cwin16 tls-a micro-service deployment - v1.0
Cwin16 tls-a micro-service deployment - v1.0Cwin16 tls-a micro-service deployment - v1.0
Cwin16 tls-a micro-service deployment - v1.0Capgemini
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Jim Dowling
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017Rick Hightower
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxGeorg Ember
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Osconvijayrvr
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)QAware GmbH
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusEmily Jiang
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingUpkar Lidder
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhiskAlex Glikson
 
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...confluent
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017iguazio
 

Similar a Vert.x devoxx london 2013 (20)

StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationBKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
 
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...
 
Cwin16 tls-a micro-service deployment - v1.0
Cwin16 tls-a micro-service deployment - v1.0Cwin16 tls-a micro-service deployment - v1.0
Cwin16 tls-a micro-service deployment - v1.0
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
 
Cloud computing: highlights
Cloud computing: highlightsCloud computing: highlights
Cloud computing: highlights
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
 
Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
 

Último

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Vert.x devoxx london 2013

  • 1.
  • 2. vert.x asynchronous applications + big data Pid – Stuart Williams Consulting Architect SpringSource @pidster
  • 3. Pid (Stuart Williams) Speaker Bio ■ Consulting Architect at SpringSource / Pivotal Application architecture, performance (and hand-waving) ■ Projects ■ Communities ■ vert.x ■ Apache Tomcat ■ Apache Oltu (OAuth) ■ Groovy 3
  • 4. vert.x project Project Lead @timfox Committers @pidster @normanm (netty) 4
  • 5. 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 5
  • 6. Key Features Hybrid Reactor Polyglot Container TCP/SSL clients and servers HTTP/HTTPS clients and servers – including WebSockets File system Event bus 100% asynchronous 6
  • 7. Code! Super simple HTTP server Serves files by matching request path One example for each language 7
  • 8. JavaScript – Mozilla Rhino load('vertx.js’) vertx.createHttpServer().requestHandler(function(req) { var file = req.path === '/' ? 'index.html' : req.path; req.response.sendFile('webroot/' + file); }).listen(8080) 8
  • 9. Python – www.jython.org import vertx server = vertx.create_http_server() @server.request_handler def request_handler(req): file = "index.html" if req.uri == "/" else req.uri req.response.send_file("webroot/%s"%file) server.listen(8080) 9
  • 10. Ruby – jruby.org require "vertx" Vertx::HttpServer.new.request_handler do |req| file = req.uri == "/" ? "index.html" : req.uri req.response.send_file "webroot/#{file}” end.listen(8080) 10
  • 11. Groovy – groovy-lang.org vertx.createHttpServer().requestHandler { req -> def file = req.uri == "/" ? "index.html" : req.uri req.response.sendFile "webroot/$file” }.listen(8080) 11
  • 12. Java import org.vertx.java.core.Handler; import org.vertx.java.core.http.HttpServerRequest; import org.vertx.java.deploy.Verticle; public class Server extends Verticle { public void start() { vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { String file = req.path.equals("/") ? "index.html" : req.path; req.response.sendFile("webroot/" + file); } }).listen(8080); } } 12
  • 13. Scala – soon! vertx.createHttpServer .requestHandler { req: HttpServerRequest => val file : String = if (req.path == “/”) “/index.html” else req.uri req.response.sendFile("webroot/" + file) } .listen(8080) 13
  • 14. More languages? DynJS 100% InvokeDynamic Alternative to Rhino for JavaScript Node.js Compatibility for vert.x Clojure? What language support do you want see? 14
  • 15. Thread Pools Non-blocking Event Loops Core Loop Acceptors Blocking Worker Pool 15
  • 16. 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! 16
  • 17. 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 17
  • 18. Components Server & Client TCP HTTP WebSocket SockJS Event Bus Point-to-point, publish-subscribe Transparent clustering 18
  • 19. 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. Transparent clustering 19
  • 20. Event Bus – 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’ }) }) 20
  • 21. Event Bus – Extended to 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 21
  • 22. Modules  Authentication Manager ■ Web Server  Form Upload ■ Work Queue  JDBC Persistor ■ AMQP  Mailer ■ More…  Mongo Persistor  Session Manager 22
  • 23. mod-web-server load('vertx.js’) var config = { "web_root": <web_root>, "port", <port>, "ssl": <ssl>, "key_store_password": <key_store_password>, "key_store_path": <key_store_path>, } vertx.deployModule('vertx.web-server-v1.0', config, 1, function() { // deployed }); 23
  • 24. Composition Deploy code using code Modules are unit of composed code Deploy modules using a verticle Or provide multiple verticles inside a module Remember: verticles communicate using the Event Bus. 24
  • 25. Architecture I/O verticles Logic verticles Separation of concerns Workers if required Event Bus Polyglot Worker verticle 25
  • 27. Big Fast Data Realtime Analytics Dashboards & APIs WebSocket SockJS Polyglot Integration Use language independent format like JSON, XML for data Exchange messages using event bus 27
  • 28. Fast Data – RabbitMQ AMQP message broker Use for queuing, routing messages and WAN clustering 28
  • 29. Big/Fast Data – Redis “Data Structure Server” Key-Value store Pub-sub messaging Use for caching verticle data, broadcasting to verticles 29
  • 30. Big/Fast Data – GemFire Compute Grid / Distributed Cache Embeddable Key-Value store Use for large partitioned caches, high performance compute, WANs Send data to vert.x using CacheListeners, subscriptions, AsyncQueues 30
  • 31. Big Data – Hadoop Hive – of course! SQL queries via JDBC worker verticle Standard pattern via event bus Use for ad-hoc queries on large datasets 31
  • 32. Big Data – MQTT  MQTT is a machine-to-machine (M2M) / "Internet of Things” connectivity protocol.  Extremely lightweight publish/subscribe messaging transport.  It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.  Eclipse Paho Coming soon! 32
  • 33. Big Data – Intravert (@zznate - apigee)  Processors, filters and procedures allow you perform arbitrary programmatic transformations on the server side before the results are returned to the client.  Execute procedures and join like logic in a single RPC request eliminating round-trips  A simple transport and JSON API that runs over HTTP allows clients to choose from JSON, JSON compressed by smile, & even big fat sexy XML  A real REST interface (ever thought about what would a Cassandra hyper media API look like?)  Work with simple familiar objects like String or Integer instead of bytes 33
  • 34. v2.0 – Features  New ClassLoader  Netty 4.0  Languages as modules  Flexible Module repositories, including Maven  Management 34
  • 35. v2.0 – Developer experience  Gradle template project  Maven archetype and plugins  Zero setup IDE debugging  Zero setup IDE testing  Test Tools project 35
  • 36. Management Management Agent Publishes metrics on Event Bus in JSON format Management GUI JMX Demo 36
  • 37. Real Deployment vert.x provides a JSON RPC API:  deployer.js  JsonRpcServer.groovy  Integration.groovy – worker  Spring Integration message flow to RabbitMQ Dynamically deploys components to consume queues:  Consumer.groovy – worker, Spring Integration message flow  JsonRpcClient.groovy 37
  • 38. Real Deployment I/O verticles Worker Verticles HTTP Spring Integration JSON RPC AMQP publisher Event Bus HTTP Spring Integration (Groovy DSL) JSON RPC Client AMQP Consumer 38
  • 39. 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 39
  • 40. Q&A