Reactive Architectures

Post on 28-Jul-2015

79 views 1 download

Tags:

Transcript of Reactive Architectures

Reactive ArchitecturesRalph Winzinger, Senacor Technologies

who am I?Ralph Winzinger Principal Architect, Senacor Technolgies

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

@rwinz ralph.winzinger@senacor.com

what’s up?

why reactive?

application structure

deployment & operating

organizational impact

development process

functional reactive

programming

aspirin - candy for programmers

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

what’s up?

why reactive?

application structure

deployment & operating

organizational impact

development process

functional reactive

programming

digitalization

architectural goals

reactiveapplication resilienceelasticity

responsiveness

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

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

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

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, …

λI’ve seen the light … !

lambdas

streams

optionals

futures

https://github.com/ReactiveX/RxJava

RxJava

observable

observable future

loads of functions

persistence

primary goal: efficiency

oracle mongo neo4jhadoop ???

persistence

primary goal: efficiency

polyglot persistence - the best tool for the job

IMDG - high performance cache first approach

communicationclient

service

service

HTTP & WebSockets

HTTP & Messaging

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

communicationclient

service

service

HTTP & WebSockets

HTTP & Messaging

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?

event sourcing & CQRS

aggregate

createEvent(cmd) apply(ev)

command

publishconsumestore social

service

consume

hadoop

graphDB

analytics service

query

serializationservice

service

human readable data formats are great!

yeah!

except there is no human to read that stuff …

😣

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XMLJSONcapnproto protobuf

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto protobuf

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto

protobuf

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobufjava ser XML

JSON

capnproto

protobuf

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser XMLJSONcapnproto protobuf

java ser

XML

JSON

capnproto

protobuf

serialization

java ser XMLJSONcapnproto protobuf

size speed

java ser

XML

JSON

capnproto

protobuf

java ser

XML

JSON

capnproto

protobuf

deployment & opsscale out & resilience

one service per server

ultra-fast deployment

precise monitoring

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

wanna play?angular.js + websockets

vert.x 3 + Java8 + RxJava hystrix + dashboard

mongoDB

1000-2000 tps

@rwinz ralph.winzinger@senacor.com

thank you

@rwinz ralph.winzinger@senacor.com