Reactive Microservices with Vert.x

34
Microservices In the beginning there was Vert.x

Transcript of Reactive Microservices with Vert.x

Page 1: Reactive Microservices with Vert.x

Microservices

In the beginning there was Vert.x

Page 2: Reactive Microservices with Vert.x

Braz, Anderson

Software Engineer

Java Man since 2000, postgradute,

open source contributor, speaker

and training consultant

mrbrazjava

Page 3: Reactive Microservices with Vert.x

Monolith Microservices

Page 4: Reactive Microservices with Vert.x
Page 5: Reactive Microservices with Vert.x
Page 6: Reactive Microservices with Vert.x

Why is responsiveness

now more important than

ever?

Mobile

Devices

Cloud

Environment

Multicore

Architecture

Real-time Interactive Collaborative

Page 7: Reactive Microservices with Vert.x

Reactive

“Readly responsive to a stimulus”

Responsive (React to Users)

Resilient (React to Failure)

Elastic (React to Load)

Message Driven (React to Events)

Page 8: Reactive Microservices with Vert.x

Message Driven

“The flow of the program is determined by events”

Page 9: Reactive Microservices with Vert.x

Immutability

Avoid share mutable states and

objects

Page 10: Reactive Microservices with Vert.x

Avoid Blocking

Kills Scalability and Performance

Page 11: Reactive Microservices with Vert.x

Elastic

“Capable of being easily

expanded or upgraded on demand”

Page 12: Reactive Microservices with Vert.x

How do I know if I have a

performance problem?

Page 13: Reactive Microservices with Vert.x

How do I know if I have a

scalability problem?

Page 14: Reactive Microservices with Vert.x

The network is

inherently unreliable

Page 15: Reactive Microservices with Vert.x

Embrace the network

“Be of the web, not behind the web”

Page 16: Reactive Microservices with Vert.x

Location

Transparency

“It is not about ESB stupid”

Page 17: Reactive Microservices with Vert.x

Resilience

“The capacity to recover

quickly from difficulties”

Page 18: Reactive Microservices with Vert.x

Old school way

Page 19: Reactive Microservices with Vert.x

Old school way

Error

Response Worst in a

Multi Thread

Page 20: Reactive Microservices with Vert.x

Worst in a

Multi

Thread

Old school way

Page 21: Reactive Microservices with Vert.x
Page 22: Reactive Microservices with Vert.x

Doing Better

Failure is

an Event

Avoid

Cascading

Manage

locally

Isolate

the failure

Page 23: Reactive Microservices with Vert.x

Responsive

“Quick to respond or react

appropriately”

Page 24: Reactive Microservices with Vert.x

Asynchronous Events

Loosely coupled architecture

Lower Latency

Better Throughput

Page 25: Reactive Microservices with Vert.x

Vert.x

Lightweight

Reactive

Polyglot

Middleware

Page 26: Reactive Microservices with Vert.x

Verticles

Non-Blocking

Event Loop

Scalable

Simple

Page 27: Reactive Microservices with Vert.x

Worker

Blocking

Worker Loop

Non-concurrent

Verticle

Page 28: Reactive Microservices with Vert.x

Event Bus

Point 2 Point

Pub/Sub

Handlers

Addressing

Page 29: Reactive Microservices with Vert.x

Server and Client

HTTP/S and TCP

Page 30: Reactive Microservices with Vert.x

File System

Both Blocking and Non-blocking

Page 31: Reactive Microservices with Vert.x

Shared Data

Local and Distributed using Hazelcast

Page 32: Reactive Microservices with Vert.x

High Availability

Cluster Manager using Hazelcast

with automatic failover

Page 33: Reactive Microservices with Vert.x

Rich Ecosystem

Asynchronous

JDBC, Mongo, Redis

Web &

Microservices

Autentication &

Ãuthorization

Metrics

(Dropwizard)

Openshift &

Docker

Unit Test

Page 34: Reactive Microservices with Vert.x

Braz, Anderson

Software Engineer

Java Man since 2000, postgradute,

open source contributor, speaker

and training consultant

mrbrazjava