Slide 1

Slide 1 text

SRDS Industrial Session October 2019 — Lyon, France Scalability and resilience in practice: current trends and opportunities Dr Julien Ponge Principal Software Engineer Dr Mark Little VP Middleware Engineering 1

Slide 2

Slide 2 text

The following content reflects the views of the authors, not necessarily those of Red Hat. They do not constitute in any way a binding or legal agreement or impose any legal obligation or duty on Red Hat. This information is provided for discussion purposes only and is subject to change for any or no reason. 2 Disclaimer

Slide 3

Slide 3 text

Today’s topic 3 Scalability + Resilience (in practice) ❌ Deep learning ❌ AI ❌ Dark mode ❌ Blockchain

Slide 4

Slide 4 text

4 Modern Distributed Systems “You can’t ignore the network anymore…”

Slide 5

Slide 5 text

Sample use-case 5 " Walk 10k steps every day ⌚ Wear a pedometer Be congratulated!

Slide 6

Slide 6 text

6

Slide 7

Slide 7 text

7 User profile service Activity service Ingestion service Public API User webapp Dashboard webapp Event stats service Congrats service Kafka topics MongoDB SMTP PostgreSQL AMQP HTTP HTTP HTTP HTTP ActiveMQ Artemis Event-driven micro-services

Slide 8

Slide 8 text

Elasticity and application state 8 Persistent & replicated state Micro-service (or “function”) Events Streams Other services

Slide 9

Slide 9 text

Elasticity and application state 9 Persistent & replicated state Micro-service (or “function”) Events Streams State boundaries + life-time Idem-potency? Other services

Slide 10

Slide 10 text

Service mesh: connect, secure, control and observe 10

Slide 11

Slide 11 text

Density is key 11 From https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/

Slide 12

Slide 12 text

12 Reactive Systems “Searching for resource-efficiency”

Slide 13

Slide 13 text

Reactive systems Reactive streams Reactive programming Reactive “Responding to stimuli” Manifesto, Actor, Messages Resilience, Elasticity, Scalability, Asynchronous, non-blocking Data flow Back-pressure Non-blocking Data flow Events, Observable Spreadsheets Akka, Vert.x Akka Streams, RxJava, Reactor, Vert.x Reactor, Reactive Spring, MS Excel, RxJava, Vert.x

Slide 14

Slide 14 text

Reactive Manifesto 14 Message Driven Elastic Resilient Responsive Asynchronous, location-transparent Isolation, replication Start / stop instances Consistent latency

Slide 15

Slide 15 text

15 x 1000 = Async I/O to the rescue!

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

Isolation and error management 17 Service Database Request ❌ Can we still provide a response? Cached data Default response …or just a timely error

Slide 18

Slide 18 text

Damage control with a circuit breaker 18 Database Circuit breaker Closed Open Half-open fail (threshold reached) call reset timeout fail success success fail (below threshold)

Slide 19

Slide 19 text

19 Reactive toolkit for the JVM All kinds of distributed services Resource-friendly Fast

Slide 20

Slide 20 text

20 Related Research & Opportunities

Slide 21

Slide 21 text

21 Async is hard(er) (callback hell is just one facet) Image from https://adrianalonso.es/desarrollo-web/apis/trabajando-con-promises-pagination-promise-chain/

Slide 22

Slide 22 text

Taming asynchronous operations 22 Promise / Future Reactive extensions Coroutines / fibers 1 item (or none) Hot / cold streams, back-pressure*, functional combinators Async disguised as regular imperative, rewritten as continuations while(stream.hasNext()) { stream.fetchNextElement() .then(this67storeInDb) .then(this67incrementDistributedCounter) .catch(this67handleError); } stream.toFlowable() .flatMap(db67store) .flatMap(distributedCounter67increment) .timeout(5, SECONDS) .retry(3) .subscribe(this67onNext, this67onError, this67onComplete()); try { while(stream.hasNext()) { item = stream.next(); db.store(item); distributedCounter.increment(); } } catch (Throwable err) { weHaveAProblem(err); } only with reactive-streams implementations, not in the original Erik Meijer paper *

Slide 23

Slide 23 text

Language and runtime 23 Coroutines and reactive extensions do not solve all problems Asynchronous abstractions in programming languages remains an interesting topic! Deadlocks Soundness Expressiveness Back-pressure tuning Memory exhaustion Error handling (…)

Slide 24

Slide 24 text

Compilation and runtime 24 JVM Open world assumption Speculative code generation Peak performance Needs more RAM Native images Closed world assumption No JIT compiler Boots fast Needs less RAM GraalVM from Oracle Labs (with Linz University and more) OpenJDK Backed by 20+ years of research

Slide 25

Slide 25 text

Powered by and more!

Slide 26

Slide 26 text

Distributed consensus 26 { active_users : 32168 } [123, “Lyon”, 10000] Replicated data stores Discovery, global state, …

Slide 27

Slide 27 text

Raft 27 “Paxos, but with bolts and nuts to implement it”

Slide 28

Slide 28 text

Flexible Paxos (Heidi Howard) 28

Slide 29

Slide 29 text

These are exciting times for research and practice in distributed systems! 29

Slide 30

Slide 30 text

linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make 
 Red Hat a trusted adviser to the Fortune 500. Thank you 30