SlideShare a Scribd company logo
Asynchronous IO with Vert.x




Peter Ledbrook - SpringSource
New kid on the block




    Javascript   Non-blocking   Single-threaded



                       Reactor pattern


                                                  2
What’s it about?

• C10K Problem
  – How do you handle 10,000+ concurrent connections?
  – Without grinding to a halt?
• Why?
  – All those mobile devices!
  – Rise of long-lived connections

          Real-time chat
                                     Instant messaging

         Twitter
                              Voice and video

                                                         3
Transloadit

• “Flexible, fast and scalable file uploading and encoding”
• Video/audio encoding on the fly
  – 500mb/s




                    Transloadit
           Video
Client                                       S3/Cloudfiles/...




                                                              4
Voxer




•   Walkie-talkie for iOS and Android
•   Live audio
•   Large number of connections
•   Push notifications



                                        5
Javascript and nothing but Javascript




                                        6
What if?

•   Language neutral framework
•   On the JVM
•   Polyglot APIs
•   Easy horizontal scalability
•   Do non-eventy stuff in a non-eventy way




                         Vert.x!

                                              7
Vert.x

• Written in Java
• Built on Netty and NIO 2
  – Java 7 only!
• Multiple language bindings
  – JRuby
  – Groovy
  – Javascript
  – Python/Clojure/Scala planned
• Based on the Reactor pattern




                                   8
How it works

                          Event loop

 App registers                         Events trigger
   handlers                              handlers



• Handlers executed synchronously
  – on a single thread
• Use handlers to pass messages
• Inter/intra application comms
  – EventBus with messages
  – Safe shared data structures

                                                    9
Features

•   Non-blocking stdio
•   TCP/IP and HTTP servers and clients
•   Web Socket support
•   (Non-blocking) Redis & Mongo modules (busmods)
•   Asynchronous file system access and stream handling

                            Pump
          ReadStream                     WriteStream

                            e.g.
        HTTP Request                     AsyncFile


                                                          10
Example - Echo socket




                        11
Example - Echo client




                        12
Scaling




            App
          instance




                     13
Scaling


                     Vertx node

                      Event bus




            App          App            App
          instance     instance       instance



                 vertx run -instances 3

                                                 14
Scaling


                  Hazelcast

                  Event bus




          Vertx     Vertx     Vertx
          node      node      node




                                      15
Extensibility via (Bus) Mods




                       Work      Web     ...
 Mailer   MongoDB
                       queue    server




                    Event bus




                                               16
Mod structure

• Core mods in $VERTX_HOME/mods
• User mods in $VERTX_MODS




                                  17
A more complex example
Realtime logging app

  Log messages




                    App


           SockJS


     Browser

                          19
Realtime logging app




                       20
Realtime logging app




                       21
Realtime logging app




                       22
Demo
Summary

• Event-driven framework for the JVM
  – Low overhead
  – Handle large number of connections
  – Great for working with streams
• Pick your own language!
  – Which will of course be Groovy ;)
• Published release: 1.0.1
  – Still early days
  – Get involved now!




                                         24
More info

• w:   https://github.com/purplefox/vert.x
       http://purplefox.github.com/vert.x/
• f:   http://groups.google.com/group/vertx

• t:   pledbrook
• b:   http://blog.springsource.com/author/peter-ledbrook/




                                                             25
Thank you!

 Questions?




              26

More Related Content

PDF
Development with Vert.x: an event-driven application framework for the JVM
PPTX
Real World Enterprise Reactive Programming using Vert.x
PPTX
Reactive applications and microservices with Vert.x tool-kit
PDF
Vert.x
ODP
Vert.x keynote for EclipseCon 2013
ODP
Groovy & Grails eXchange 2012 vert.x presentation
PPT
JUDCon Brazil 2013 - Vert.x an introduction
PPTX
Production ready Vert.x
Development with Vert.x: an event-driven application framework for the JVM
Real World Enterprise Reactive Programming using Vert.x
Reactive applications and microservices with Vert.x tool-kit
Vert.x
Vert.x keynote for EclipseCon 2013
Groovy & Grails eXchange 2012 vert.x presentation
JUDCon Brazil 2013 - Vert.x an introduction
Production ready Vert.x

What's hot (20)

PPTX
Vert.x devoxx london 2013
PDF
vert.x - life beyond jetty and apache
PPTX
vert.x - asynchronous event-driven web applications on the JVM
PPTX
Event driven microservices with vertx and kubernetes
PPTX
Vertx in production
PPTX
Vert.x vs akka
PDF
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
PDF
Introduction to node js - From "hello world" to deploying on azure
PDF
An Introduction to the Vert.x framework
PDF
Generating Visual Studio Code Extensions for Xtext DSLs
PDF
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
PDF
Modern app programming with RxJava and Eclipse Vert.x
PDF
Ozone-Wayland Support in Chromium (GENIVI 13th All Member Meeting & AMM Open ...
PDF
Running JavaScript Efficiently in a Java World
PDF
KubeFuse - A File-System for Kubernetes
PDF
Fabric8 - Being devOps doesn't suck anymore
PDF
OSv – The OS designed for the Cloud
PDF
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
PDF
Nuxeo World Session: Scaling Nuxeo Applications
KEY
Introducing Apricot, The Eclipse Content Management Platform
Vert.x devoxx london 2013
vert.x - life beyond jetty and apache
vert.x - asynchronous event-driven web applications on the JVM
Event driven microservices with vertx and kubernetes
Vertx in production
Vert.x vs akka
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introduction to node js - From "hello world" to deploying on azure
An Introduction to the Vert.x framework
Generating Visual Studio Code Extensions for Xtext DSLs
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
Modern app programming with RxJava and Eclipse Vert.x
Ozone-Wayland Support in Chromium (GENIVI 13th All Member Meeting & AMM Open ...
Running JavaScript Efficiently in a Java World
KubeFuse - A File-System for Kubernetes
Fabric8 - Being devOps doesn't suck anymore
OSv – The OS designed for the Cloud
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
Nuxeo World Session: Scaling Nuxeo Applications
Introducing Apricot, The Eclipse Content Management Platform
Ad

Similar to Vert.x introduction (20)

PDF
Developing Revolutionary Web Applications using Comet and Ajax Push
KEY
20120306 dublin js
PDF
Inside Triton, July 2015
PDF
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
PDF
321 codeincontainer brewbox
PPTX
Node.js meetup at Palo Alto Networks Tel Aviv
PPTX
World of Node.JS
KEY
Realtime rocks
PPTX
Quick look in Reactive Extensions
KEY
20120802 timisoara
PPTX
Docker Introduction
PDF
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
PDF
Are VMs Passé?
PDF
Are VM Passé?
PPTX
Realtime web2012
PDF
Scaling the Container Dataplane
PPTX
State of the Container Ecosystem
PDF
Genomic Computation at Scale with Serverless, StackStorm and Docker Swarm
PDF
IMPACT Interoperability Framework - Clemens Neudecker
PPTX
Docker-Intro
Developing Revolutionary Web Applications using Comet and Ajax Push
20120306 dublin js
Inside Triton, July 2015
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
321 codeincontainer brewbox
Node.js meetup at Palo Alto Networks Tel Aviv
World of Node.JS
Realtime rocks
Quick look in Reactive Extensions
20120802 timisoara
Docker Introduction
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
Are VMs Passé?
Are VM Passé?
Realtime web2012
Scaling the Container Dataplane
State of the Container Ecosystem
Genomic Computation at Scale with Serverless, StackStorm and Docker Swarm
IMPACT Interoperability Framework - Clemens Neudecker
Docker-Intro
Ad

More from GR8Conf (20)

PDF
DevOps Enabling Your Team
PDF
Creating and testing REST contracts with Accurest Gradle
PDF
Mum, I want to be a Groovy full-stack developer
PDF
Metaprogramming with Groovy
PDF
Scraping with Geb
PDF
How to create a conference android app with Groovy and Android
PDF
Ratpack On the Docks
PDF
Groovy Powered Clean Code
PDF
Cut your Grails application to pieces - build feature plugins
PDF
Performance tuning Grails applications
PDF
Ratpack and Grails 3
PDF
Grails & DevOps: continuous integration and delivery in the cloud
PDF
Functional testing your Grails app with GEB
PDF
Deploying, Scaling, and Running Grails on AWS and VPC
PDF
The Grails introduction workshop
PDF
Idiomatic spock
PDF
The Groovy Ecosystem Revisited
PDF
Groovy 3 and the new Groovy Meta Object Protocol in examples
PDF
Integration using Apache Camel and Groovy
PDF
CRaSH the shell for the Java Virtual Machine
DevOps Enabling Your Team
Creating and testing REST contracts with Accurest Gradle
Mum, I want to be a Groovy full-stack developer
Metaprogramming with Groovy
Scraping with Geb
How to create a conference android app with Groovy and Android
Ratpack On the Docks
Groovy Powered Clean Code
Cut your Grails application to pieces - build feature plugins
Performance tuning Grails applications
Ratpack and Grails 3
Grails & DevOps: continuous integration and delivery in the cloud
Functional testing your Grails app with GEB
Deploying, Scaling, and Running Grails on AWS and VPC
The Grails introduction workshop
Idiomatic spock
The Groovy Ecosystem Revisited
Groovy 3 and the new Groovy Meta Object Protocol in examples
Integration using Apache Camel and Groovy
CRaSH the shell for the Java Virtual Machine

Recently uploaded (20)

PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
GamePlan Trading System Review: Professional Trader's Honest Take
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Monthly Chronicles - July 2025
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.

Vert.x introduction

  • 1. Asynchronous IO with Vert.x Peter Ledbrook - SpringSource
  • 2. New kid on the block Javascript Non-blocking Single-threaded Reactor pattern 2
  • 3. What’s it about? • C10K Problem – How do you handle 10,000+ concurrent connections? – Without grinding to a halt? • Why? – All those mobile devices! – Rise of long-lived connections Real-time chat Instant messaging Twitter Voice and video 3
  • 4. Transloadit • “Flexible, fast and scalable file uploading and encoding” • Video/audio encoding on the fly – 500mb/s Transloadit Video Client S3/Cloudfiles/... 4
  • 5. Voxer • Walkie-talkie for iOS and Android • Live audio • Large number of connections • Push notifications 5
  • 6. Javascript and nothing but Javascript 6
  • 7. What if? • Language neutral framework • On the JVM • Polyglot APIs • Easy horizontal scalability • Do non-eventy stuff in a non-eventy way Vert.x! 7
  • 8. Vert.x • Written in Java • Built on Netty and NIO 2 – Java 7 only! • Multiple language bindings – JRuby – Groovy – Javascript – Python/Clojure/Scala planned • Based on the Reactor pattern 8
  • 9. How it works Event loop App registers Events trigger handlers handlers • Handlers executed synchronously – on a single thread • Use handlers to pass messages • Inter/intra application comms – EventBus with messages – Safe shared data structures 9
  • 10. Features • Non-blocking stdio • TCP/IP and HTTP servers and clients • Web Socket support • (Non-blocking) Redis & Mongo modules (busmods) • Asynchronous file system access and stream handling Pump ReadStream WriteStream e.g. HTTP Request AsyncFile 10
  • 11. Example - Echo socket 11
  • 12. Example - Echo client 12
  • 13. Scaling App instance 13
  • 14. Scaling Vertx node Event bus App App App instance instance instance vertx run -instances 3 14
  • 15. Scaling Hazelcast Event bus Vertx Vertx Vertx node node node 15
  • 16. Extensibility via (Bus) Mods Work Web ... Mailer MongoDB queue server Event bus 16
  • 17. Mod structure • Core mods in $VERTX_HOME/mods • User mods in $VERTX_MODS 17
  • 18. A more complex example
  • 19. Realtime logging app Log messages App SockJS Browser 19
  • 23. Demo
  • 24. Summary • Event-driven framework for the JVM – Low overhead – Handle large number of connections – Great for working with streams • Pick your own language! – Which will of course be Groovy ;) • Published release: 1.0.1 – Still early days – Get involved now! 24
  • 25. More info • w: https://github.com/purplefox/vert.x http://purplefox.github.com/vert.x/ • f: http://groups.google.com/group/vertx • t: pledbrook • b: http://blog.springsource.com/author/peter-ledbrook/ 25