45

The 6 Traits of Reactive Microservices

Embed Size (px)

Citation preview

Page 1: The 6 Traits of Reactive Microservices
Page 2: The 6 Traits of Reactive Microservices

IT'S A NEW WORLDYESTERDAY VS TODAY

Page 3: The 6 Traits of Reactive Microservices

Traditional applicationarchitectures and

platformsare obsolete.

— Gartner

Page 4: The 6 Traits of Reactive Microservices

THE REACTIVE ESSENCE OF A MICROSERVICE1. Isolation

2. Asynchronicity3. Autonomicity

4. Single Responsibility5. Exclusive State

6. Mobility

Page 5: The 6 Traits of Reactive Microservices

DIVIDEAND

CONQUER

Page 6: The 6 Traits of Reactive Microservices

ISOLATIONTHE FOUNDATION

Page 7: The 6 Traits of Reactive Microservices

IT WILL SLICE UP YOUR1. ORGANIZATION2. ARCHITECTURE

Page 8: The 6 Traits of Reactive Microservices

Organizations which design systems...are

constrained to produce designs which are

copies of the communication

structures of these organizations.

— Melvin Conway

Page 9: The 6 Traits of Reactive Microservices

USE BULKHEADING

Page 10: The 6 Traits of Reactive Microservices

BUTWHAT ABOUT THE

TITANIC?

Page 11: The 6 Traits of Reactive Microservices

RESILIENCEIS THE ABILITY TO SELF-HEAL, AND REQUIRES

COMPARTMENTALIZATIONOF FAILURE

Page 12: The 6 Traits of Reactive Microservices

GOASYNCHRONOUS

Page 13: The 6 Traits of Reactive Microservices

ASYNC IO—IS ABOUT NOT BLOCKING THREADS

ASYNC COMMUNICATION—IS ABOUT NOT BLOCKING REQUESTS

Page 14: The 6 Traits of Reactive Microservices

ASYNCHRONOUS

IO

Page 15: The 6 Traits of Reactive Microservices

WHY IS BLOCKING SO BAD?

Page 16: The 6 Traits of Reactive Microservices

SYNCHRONOUS DISPATCH

Page 17: The 6 Traits of Reactive Microservices

ASYNCHRONOUS DISPATCH

Page 18: The 6 Traits of Reactive Microservices

ASYNCHRONOUSCOMMUNICATION

Page 19: The 6 Traits of Reactive Microservices

ASYNC COMMUNICATION ALLOWS DECOUPLING IN

SPACEAND

TIME

Page 20: The 6 Traits of Reactive Microservices

ASYCHRONOUS MESSAGE-PASSINGEMBRACES THE CONSTRAINTS OFDISTRIBUTED SYSTEMS

Page 21: The 6 Traits of Reactive Microservices

THE WORLD IS GOING STREAMING

Page 22: The 6 Traits of Reactive Microservices

ACTAUTONOMOUSLY

Page 23: The 6 Traits of Reactive Microservices

PROMISE THEORYLEADS THE WAY

Page 24: The 6 Traits of Reactive Microservices

THE WORD 'MICROSERVICE'CONSIDERED HARMFUL

Page 25: The 6 Traits of Reactive Microservices

A SERVICE SHOULD DODO ONE THING

AND

DO IT WELL

Page 26: The 6 Traits of Reactive Microservices

The Unix philosophy:Write programs that do one thing & do it well.

Write programs to work together.

— Doug McIlroy

Page 27: The 6 Traits of Reactive Microservices

BUT WHAT ABOUT

STATE?

Page 28: The 6 Traits of Reactive Microservices

OWN YOUR STATE, EXCLUSIVELY

Page 29: The 6 Traits of Reactive Microservices

THERE IS NO SUCH THING AS A"STATELESS" ARCHITECTUREIT'S JUST SOMEONE ELSE'S PROBLEM

Page 30: The 6 Traits of Reactive Microservices

BOUNDEDCONTEXTS

Page 31: The 6 Traits of Reactive Microservices

POLYGLOTPERSISTENCE

Page 32: The 6 Traits of Reactive Microservices

The truth is the log.The database is a cache of a subset of the log.

— Pat Helland

Page 33: The 6 Traits of Reactive Microservices

FAVOR

EVENT LOGGING

Page 34: The 6 Traits of Reactive Microservices

GREAT FIT FOR MESSAGE-PASSING SYSTEMS

> Signal Intent: Use Commands> Publish Facts: Use Events

SINGLE WRITER PRINCIPLE> Minimized Contention

> High throughput & Low latency

Page 35: The 6 Traits of Reactive Microservices

EVENT SOURCING

WITH CQRS

Page 36: The 6 Traits of Reactive Microservices

AVOIDS THE INFAMOUSOBJECT-RELATIONALIMPEDENCE MISMATCH

Page 37: The 6 Traits of Reactive Microservices

STAY MOBILE BUT ADDRESSABLE

Page 38: The 6 Traits of Reactive Microservices

But I'll take my time anywhere.

I'm free to speak my mind anywhere.And I'll redefine

anywhere.Anywhere I roam.

Where I lay my head is home.

— Wherever I May Roam by Lars Ulrich, James Hetfield (Metallica)

Page 39: The 6 Traits of Reactive Microservices

WHY VIRTUAL ADRESSING?

1. Load-balancing between stateless services2. State replication between stateful services

3. Relocation of a stateful service

Page 40: The 6 Traits of Reactive Microservices

REFERENCES SHOULD ALWAYS WORK

Page 41: The 6 Traits of Reactive Microservices

SO, THERE YOU HAVE IT

THE 6 TRAITS OF A REACTIVE MICROSERVICE1. Isolation

2. Asynchronicity3. Autonomicity

4. Single Responsibility5. Exclusive State

Page 42: The 6 Traits of Reactive Microservices

BY NOW WE SHOULD HAVE A PRETTY GOOD UNDERSTANDING OF WHAT

CHARACTERIZES A SINGLEREACTIVE MICROSERVICE

Page 43: The 6 Traits of Reactive Microservices

HOWEVERONE MICROSERVICE

IS NOT OF MUCH USETHEY COME IN SYSTEMS

STAY TUNED FOR EPISODE 3

Page 44: The 6 Traits of Reactive Microservices
Page 45: The 6 Traits of Reactive Microservices