Reactive Architectures

30
Reactive Architectures Ralph Winzinger, Senacor Technologies

Transcript of Reactive Architectures

Page 1: Reactive Architectures

Reactive ArchitecturesRalph Winzinger, Senacor Technologies

Page 2: Reactive Architectures

who am I?Ralph Winzinger Principal Architect, Senacor Technolgies

emerging technolgies, high scalable architectures, engineering processes, dissemination of knowledge

@rwinz [email protected]

Page 3: Reactive Architectures

what’s up?

why reactive?

application structure

deployment & operating

organizational impact

development process

functional reactive

programming

Page 4: Reactive Architectures

aspirin - candy for programmers

https://www.flickr.com/photos/atul666/237027107

Page 5: Reactive Architectures

what’s up?

why reactive?

application structure

deployment & operating

organizational impact

development process

functional reactive

programming

Page 6: Reactive Architectures

digitalization

Page 7: Reactive Architectures

architectural goals

reactiveapplication resilienceelasticity

responsiveness

Page 8: Reactive Architectures

architectural blueprintHTML / JS

service

legacy / core integration

IoT 3rd…

API gateway

service

IMDG

native, reactive user experience,optimized for low bandwidth access

offer high scalable service integration to address fine grained request/response cycles and various 3rd parties

maximize functional decoupling and vertical decomposition up to microservices

optimized persistence technology aligned with functional requirement up to high performance in-memory computing

transparently integrate legacy systems into state-of-the-art architectures

Page 9: Reactive Architectures

clients & integrationhigh quality, native like user experience

mobile first, responsive design (if not native)

async communication for maximized responsiveness

full-duplex communication (push, partial update)

high scalable gateway services, optimized for handling finegrained requests, long polling requests, server push

integration of new channels (e.g. WebRTC, messaging, voice, video-chat)

async, non-blocking

Angular.js Node.js / Vert.x

Page 10: Reactive Architectures

servicesno app containers

shared nothing service architecture for easy scale out

independent development and deployment

vertical decomposition aligned with functional features

further breakdown towards single responsibility ans micro services

lightweight communication, self discovery at best

resilient inter-service connection for failover and scalability

spring boot vert.x

Page 11: Reactive Architectures

shared nothing, almostservice service service maximum isolation between services

- no shared state (including persistence) - no shared domain model or logic

easy scale out & easy failover

share non-functional infrastructure code - network access, serialization, failover, …

Asgard, Hystrix, Ribbon, Finagle, Simian Army, Hazelcast, …

Page 12: Reactive Architectures

λI’ve seen the light … !

lambdas

streams

optionals

futures

https://github.com/ReactiveX/RxJava

RxJava

observable

observable future

loads of functions

Page 13: Reactive Architectures

persistence

primary goal: efficiency

oracle mongo neo4jhadoop ???

Page 14: Reactive Architectures

persistence

primary goal: efficiency

polyglot persistence - the best tool for the job

IMDG - high performance cache first approach

Page 15: Reactive Architectures

communicationclient

service

service

HTTP & WebSockets

HTTP & Messaging

Page 16: Reactive Architectures

„How did we end up here?“, Trisha Gee & Todd Montgomery, QCon NY 2015

Page 17: Reactive Architectures

communicationclient

service

service

HTTP & WebSockets

HTTP & Messaging

Page 18: Reactive Architectures

event sourcing

⓶ derive object state := left fold all events

⓵ every state change is triggered by an event

apply(apply(apply(apply(new, ev0), ev1), ev2), …)

⓷ do not store state, but events

so … no persistent state … but how do I query data?

Page 19: Reactive Architectures

event sourcing & CQRS

aggregate

createEvent(cmd) apply(ev)

command

publishconsumestore social

service

consume

hadoop

graphDB

analytics service

query

Page 20: Reactive Architectures

serializationservice

service

human readable data formats are great!

yeah!

except there is no human to read that stuff …

😣

Page 21: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XMLJSONcapnproto protobuf

Page 22: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto protobuf

Page 23: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto

protobuf

Page 24: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto

protobuf

Page 25: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobuf

java ser

XML

JSON

capnproto

protobuf

Page 26: Reactive Architectures

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser

XML

JSON

capnproto

protobuf

java ser

XML

JSON

capnproto

protobuf

Page 27: Reactive Architectures

deployment & opsscale out & resilience

one service per server

ultra-fast deployment

precise monitoring

Page 28: Reactive Architectures

wanna play?

message based communication

auto discovery

location agnostic deployment service monitoring

auto spawning / suicide

setup / tear down virtual machines

async / parallel service calls

local caching

fallback services

service call timeoutpartial page update

server -> client push

circuit breaker

back pressure / throttling

bulk head

Page 29: Reactive Architectures

wanna play?angular.js + websockets

vert.x 3 + Java8 + RxJava hystrix + dashboard

mongoDB

1000-2000 tps

@rwinz [email protected]

Page 30: Reactive Architectures

thank you

@rwinz [email protected]