Apps software development with Vert.X

22
K t x ( 8 5 ! a ! > " [ K S 9 # Vert.X APPS SOFTWARE DEVELOPMENT WITH Hit View -> Show Presenter Notes to view important information! U @MAKINGDEVS @NEODEVELOP GITHUB.COM/ MAKINGDEVS

Transcript of Apps software development with Vert.X

Page 1: Apps software development with Vert.X

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

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

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

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

MAIN COMPONENTS

Core concepts… C10K problem

_

a

II

Page 6: Apps software development with Vert.X

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

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

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

ARCHITECTUREMain components &

communication

¼

!

III

Page 10: Apps software development with Vert.X

www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: [email protected]

HOW IT WORKS?deep inside

Page 11: Apps software development with Vert.X

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

MAIN CONCERNS

What kind of issues we found treating events?

K"

IV

Page 13: Apps software development with Vert.X

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

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

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

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

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

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

DEMO

Everything could be happen in this demo….

)

9V

Page 20: Apps software development with Vert.X

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

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

YOUFOR ATTENDING

'

THANK

See you soon!