This document provides an overview of Vert.x, an application platform that runs on the JVM and allows building reactive applications. Vert.x is asynchronous, non-blocking, and distributed. It uses an event-driven architecture and supports polyglot programming through modules for Java, JavaScript, Python, Ruby, and other languages. Vert.x applications are composed of lightweight verticle components that communicate asynchronously through an event bus. It provides clustering, failover, and load balancing capabilities to build scalable and resilient applications.
1 of 26
Downloaded 17 times
More Related Content
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
2. Intro
?
Scalable application platform
?
Real-time system (web applications, game and ...)
?
Similar to Node.js but not a clone!
?
Some characteristics like Erlang
?
Started by Tim Fox (RabbitMQ , HornetQ , Red Hat
Middlewares) in 2011
?
Sponsored by VMWare (SpringSource) and Red Hat!
?
Manged by Eclipse Foundation
3. Requirements
?
JDK 7 or later (Oracle distribution or OpenJDK)
?
server.js
$ vertx run server.js -instance 10
6. Features
?
Polyglot
?
Asynchronous programming model (Non blocking
I/O and event-driven)
?
Actor-like concurrency
?
Distributed Event Bus (spans the client and server
side)
?
Embedded as a library
?
Module system
9. Polyglot
?
New JDK 7 Feature (better support for
Dynamically Typed Languages in the JVM)
?
e.g. invokedynamic bytecode instruction
?
Support for a New Language as module!
12. Distributed Event Bus
?
Communication mechanism between
applications components (Clustered)
?
Spans the client and server side
?
Use same API in the browser
?
Pub-Sub, Request/Response
14. Actor-like concurrency
?
No more synchronized, volatile or explicit
locking
?
Write all your code as single threaded
?
Components communicate with each other
over the event bus by exchanging messages.
?
Number of threads to be equal to the number
of available cores on the machine.
15. Concurrency Model
(Thread model)
?
Hybrid threading model
?
Event Loops = number of threads to the available
cores on the server
?
Multi-reactor pattern (more than one event loop)
?
The Golden Rule - Don't block the event loop!
?
Worker Verticles can block - never executed
concurrent (JDBC , …)
?
Shared map (immutable, distributed)
16. Verticle
?
Verticle run insdide a vert.x instance
?
verticle instance is never executed by more
than one thread concurrently (single threaded).
?
verticle instances communicate with each
other over the event bus by exchanging
messages.
?
verticle instances correspond to actors. (more
coarse grained than actors)
20. Module System
?
Public module registry
?
Auto-redeploy of Modules
?
JSON configuration
?
New non-core features done as modules
?
Runnable modules vs. includable modules
?
Even new language support is done via
modules!
21. Vert.x API
Container API
TCP/SSL servers and clients
UDP
HTTP/HTTPS servers and clients
WebSockets servers and clients
The distributed event bus
Periodic and one-off timers
Buffers
Flow control
File-system access
Shared map and sets
Accessing configuration
SockJS
Logging (JUL)
DNS Client
22. How Vert.x scale
?
Many instance of one verticle
?
Clustering (auto-magic, configurable)
?
Eventbus spans through all machine in cluster and browser
?
Use all available core
?
Hybrid thread model
?
Automatic failover (-ha and "bare" Vert.x instances)
?
HA groups (-hagroup)
?
Quora (network partitions)(-quorum)
?
Automatic load-balancing for TCP and HTTP ( available cores)
25. Usage
?
Nodyn: Nodyn is a Node.js compatible
framework, running on the JVM powered by
the DynJS Javascript runtime with an
embedded Vert.x
?
Yoke: Yoke is a minimal and flexible Vert.x web
application framework
?
Edge