the reactive manifesto: message-driven, resilient, elastic, responsive - stefano baghino - mts...

33
The Reactive Manifesto Message driven, Fault tolerant, Elastic, Responsive

Upload: codemotion

Post on 29-Jan-2018

552 views

Category:

Software


5 download

TRANSCRIPT

Page 1: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

The Reactive Manifesto Message driven, Fault tolerant, Elastic, Responsive

Page 2: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Hello! I am Stefano Baghino

Software Engineer @ DATABIZ Regular Attendee @ MTS I code. Therefore, I introduce bugs.

Page 3: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

0. Reactive what? What are we going to talk about?

Page 4: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Reactive Programming

Page 5: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Reactive Programming

Functional Reactive Programming

Page 6: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Reactive Programming

Functional Reactive Programming

Reactive Systems

Page 7: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

1. Responsiveness Never too late!

Page 8: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano
Page 9: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

What does it mean “to be responsive”?

Page 10: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Page 11: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Performance

Page 12: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Boom! Nailed it! End of story.

Right?

Page 13: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Let’s take a little step back

Page 14: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

We live in a new world

�  Billions of users are on the Internet at any time

�  IoT will push the challenge up a notch

�  The world runs faster than your server

Page 15: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Scalable

Page 16: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Being scalable is not enough

Page 17: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Elastic

Page 18: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Even elasticity is not enough

Page 19: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Elastic Fault tolerant

Page 20: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

2. Solid foundations How do we get there?

Page 21: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Decouple all the things!

�  Decoupling is the key

�  Loosely coupled components scale well

�  Loosely coupled components can be more resilient

Page 22: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Elastic Fault tolerant

Page 23: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Decouple all the things!

�  We need a way to decouple our components

�  Asynchronous message passing is ideal

�  If naturally fits distributed systems

Page 24: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Message driven can also mean event driven

Forwarding

Request / Response

Message broker

Page 25: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Responsive

Message driven

Elastic Fault tolerant

Page 26: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Good, how can we do it?

Page 27: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

A couple of words on the Actor Model

�  A model for concurrent computation

�  Actors can only react to asynchronous messages

�  When a message arrives, they can only:

1.  send a message

2.  create a new actor

3.  change their own behaviour

Page 28: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Actors: great for fault tolerance

Page 29: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Interested? Codemotion got you covered!

Page 30: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

The four traits of Reactive Systems

1.  Responsive → React to clients

2.  Elastic → React to load

3.  Fault tolerant → React to failure

4.  Message driven → React to stimuli

Page 31: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

What is the Reactive Manifesto?

The Reactive Manifesto is an initiative to define a tech

agnostic shared vocabulary, to define an architectural

pattern for Reactive Systems.

It’s not about dogmas, it’s about critical thinking.

Page 32: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

What is the Reactive Manifesto?

Go home, read it.

If you agree, you can sign it.

If you don’t, debate. It’s only good.

If you think you can improve it, make a PR.

www.reactivemanifesto.org

Page 33: The Reactive Manifesto: Message-driven, Resilient, Elastic, Responsive - Stefano Baghino - MTS Codemotion Tech Meetup - Milano

Thanks! Debate time? Or is it pizza? Hey! I’ll be a speaker at Codemotion too! Interested in Big Data? I’ll talk about Apache Spark!

You can find me at: @stefanobaghino [email protected]