apps software development with vert.x

Post on 14-Jul-2015

219 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com

BEGIN

END

What is VertX?

$I

Main Components

(II

ArchitectureÑ

III

CURRENT AGENDA

Main concerns

bV

Demo

KIV

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

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: 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

MAIN COMPONENTS

Core concepts… C10K problem

_

a

II

www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com

VERTICLES, MODULES & INSTANCESwhat is this?

www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com

VERTICLES, MODULES & INSTANCESwhat is this?

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: juan@makingdevs.com

ARCHITECTUREMain components &

communication

¼

!

III

www.makingdevs.comPhone: +52(55) 185 30 73 | e-mail: juan@makingdevs.com

HOW IT WORKS?deep inside

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: juan@makingdevs.com

MAIN CONCERNS

What kind of issues we found treating events?

K"

IV

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: juan@makingdevs.com

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: juan@makingdevs.com

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

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: juan@makingdevs.com

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: juan@makingdevs.com

VERT.X MODULES

Use the actual code, there’s a lot of modules ready for use in: http://modulereg.vertx.io

ZIV

#

DEMO

Everything could be happen in this demo….

)

9V

QUESTIONS

and

ANSWERSC’mon, we want to help and improve

this presentation…

R% Go ahead. Ask away.

Give us your best shot.

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: juan@makingdevs.com

FOLLOW USsocial links

YOUFOR ATTENDING

'

THANK

See you soon!

top related