2. www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
BEGIN
END
What is
VertX?
$
I
Main
Components
(II
Architecture
ÑIII
CURRENTAGENDA
Main
concerns
bV
Demo
K
IV
3. WHAT IS
VERT.X?
Vert.x is a lightweight, high
performance application
platform for the JVM that's
designed for modern mobile,
web, and enterprise
applications.
I
4. polylglot
Java, JavaScript,
CoffeeScript, Ruby,
Python or Groovy, is your
choice.
Take advantage of the
JVM
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
simple
Write code normally,
no complex
configuration; the API
is so simple…
scalable
Uses messaging to
scale, we can use the
cores of the same
machine
concurrency
Simple actor-like
concurrency, you don't
have to deal with
threads
VERT.X FEATURES
8. j
å
^
K
reusable code
VERT.X MODULES
Registry: Vert.X apps
uses many modules
Community Check http://
modulereg.vertx.io
Many verticles:
Encapsulated and
together in a package.
Easy to use: modules are
found in Binary or Maven
repo
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
11. main technologies
WHAT’S INSIDE?
•It’s build on top of Netty - https://github.com/netty/netty
•Hazelcast for network discovery of nodes
•Jackson for JSON expose
•Java 7+
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
13. platforms and languages
ABOUT THE LANGUAGES
Main concern:
Javascript - https://www.destroyallsoftware.com/talks/wat
Vert.X resolution
Polyglot programming - http://vertx.io
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
14. vertical scaling
ABOUT SCALING
Main concern:
how do we scale?, when you deploy a JVM program is single thread
Vert.X resolution
•Runtime.availableProcessors() == 4
•vertx run Verticle -instances 4
•Verticles:
•Are assigned to one event/loop
•Always executed on assigned thread
•Has own class loaders and cannot shared global state
•Can write the code assuming single threading
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
15. what is the process for coordinate work?
ABOUT COMMUNICATION
Main concern:
how can we communicate between components? tcp, udp, sockets, signaling,
etc…
Vert.X resolution
•The event bus
•Addressing: Is a simple string, with dot-style namespacing(recommended)
•Handler registration
•Pub/Sub
•P2P
•Messages types: String, primitives, vertx…JsonObject, vertx…Buffer
•Distributed Vert.X(Event Bus), even the browser(SockJS Bridge)
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
16. what is the process for coordinate work?
ABOUT COMMUNICATION
Main concern:
How do we share state? It’s dangerous if it’s mutable!!!
Vert.X resolution
•Vert.X Shared State
•SharedData object
•java.util.concurrent.ConcurrentMap
•java.util.Set<E>
•Elements must be inmutable
•Only available within instances, not in a cluster
•Allowed values: String, primitives, byte[]
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com
17. reactor pattern
ABOUT THE EVENT LOOP
Main concern:
Single thread is single event loop, and all is in it; is dangerous block the event
loop. What we can do with blocking work(e.g. JDBC)?
Vert.X resolution
•Worker Verticles
•Not assigned to event loop thread and executes in the background thread
pool
•Not concurrently executed
•Not able to use TCP servers
•We only need the event bus, but less of them should be use them.
www.makingdevs.com
Phone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com