apps software development with vert.x
TRANSCRIPT
![Page 1: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/1.jpg)
K
tx
(
8
5
!
a
!
>
"
[K
S
9
#
Vert.X
APPS SOFTWARE DEVELOPMENT
WITH
Hit View -> Show Presenter Notesto view important information!
U
@MAKINGDEVS@NEODEVELOP
GITHUB.COM/MAKINGDEVS
![Page 2: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/2.jpg)
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
BEGIN
END
What is VertX?
$I
Main Components
(II
ArchitectureÑ
III
CURRENT AGENDA
Main concerns
bV
Demo
KIV
![Page 3: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/3.jpg)
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
![Page 4: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/4.jpg)
polylglot
Java, JavaScript, CoffeeScript, Ruby,
Python or Groovy, is your choice.
Take advantage of the JVM
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
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
![Page 5: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/5.jpg)
MAIN COMPONENTS
Core concepts… C10K problem
_
a
II
![Page 6: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/6.jpg)
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
VERTICLES, MODULES & INSTANCESwhat is this?
![Page 7: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/7.jpg)
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
VERTICLES, MODULES & INSTANCESwhat is this?
![Page 8: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/8.jpg)
j
å
^
K
reusable codeVERT.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.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 9: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/9.jpg)
ARCHITECTUREMain components &
communication
¼
!
III
![Page 11: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/11.jpg)
main technologiesWHAT’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.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 12: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/12.jpg)
MAIN CONCERNS
What kind of issues we found treating events?
K"
IV
![Page 13: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/13.jpg)
platforms and languagesABOUT THE LANGUAGES
Main concern: Javascript - https://www.destroyallsoftware.com/talks/wat
Vert.X resolution Polyglot programming - http://vertx.io
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 14: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/14.jpg)
vertical scalingABOUT 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.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 15: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/15.jpg)
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: [email protected]
![Page 16: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/16.jpg)
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.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 17: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/17.jpg)
reactor patternABOUT 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.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
![Page 18: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/18.jpg)
VERT.X MODULES
Use the actual code, there’s a lot of modules ready for use in: http://modulereg.vertx.io
ZIV
#
![Page 19: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/19.jpg)
DEMO
Everything could be happen in this demo….
)
9V
![Page 20: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/20.jpg)
QUESTIONS
and
ANSWERSC’mon, we want to help and improve
this presentation…
R% Go ahead. Ask away.
Give us your best shot.
![Page 21: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/21.jpg)
FACEBOOKfacebook.com/makingdevs
TWITTER twitter.com/makingdevs
YOUTUBE+youtube.com/makingdevs
VIMEOyoutube.com/makingdevsx
t
+
v
www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]
FOLLOW USsocial links
![Page 22: Apps software development with Vert.X](https://reader038.vdocuments.site/reader038/viewer/2022110122/55a522141a28abbf348b4822/html5/thumbnails/22.jpg)
YOUFOR ATTENDING
'
THANK
See you soon!