anatomie von microservice landschaften
TRANSCRIPT
![Page 1: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/1.jpg)
Anatomie von
Microservice Landschaften
![Page 2: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/2.jpg)
Michael PlödPrincipal Consultant bei innoQ
@bitboss
![Page 3: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/3.jpg)
Die klassische old school
Software-Architektur
![Page 4: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/4.jpg)
HugeSOAPEndpoints
HugeBusinessServices
HugeDAOs
Business Model
Client
DTO
View Model
Central RDBMS
ER-Model
Network
Network
![Page 5: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/5.jpg)
HugeSOAPEndpoints
HugeBusinessServices
HugeDAOs
Business Model
Client
DTO
View Model
Central RDBMS
ER-Model
Network
Network
MONOLITH
One huge system to serve them all
![Page 6: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/6.jpg)
„In short, the microservice architectural style is an approach to developing a single application as a
suite of small services, each running in its own process and communicating
with lightweight mechanisms, often an HTTP resource API.“
Martin Fowler:
http://martinfowler.com/articles/microservices.html
![Page 7: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/7.jpg)
1 Klein
2 Autonom
3 Kollaborativ
![Page 8: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/8.jpg)
Accounting
Customer
Customer Service
Monetary Transactions
Crediting
Billing
Trading
![Page 9: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/9.jpg)
Microservices sind kein „Freibier“
![Page 10: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/10.jpg)
!
Die Herausforderung ist weniger die Implementierung eines Microservices selbst, sondern das Umfeld in dem man selbige betreibt.
![Page 11: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/11.jpg)
Herausforderungen
Business Design Deployment
Collabora-tionMonitoring
Interface Design
Resilience
![Page 12: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/12.jpg)
1 Business Design
Leite Microservices vomBounded Context ab
Modularisierung ist ein 1. Schritt
Hinterfrage N-Tier Architekturen
![Page 13: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/13.jpg)
2 Interface Design
Orchestrierung vs Choreographie
oder
Synchron vs Asynchron
![Page 14: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/14.jpg)
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
Synchrone Orchestrierung
![Page 15: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/15.jpg)
AuthorService
EMail Service
Roles Service
OutBound Service
Asynchrone Choreographie
Author Created Event
![Page 16: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/16.jpg)
!Asynchrone Microservices benötigen eine Message Broker Infrastruktur
![Page 17: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/17.jpg)
Lasst uns den ohnehin lizensierten ESB der
gescheiterten SOA Initiative verwenden
![Page 18: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/18.jpg)
NEIN
![Page 19: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/19.jpg)
!Präferiere „dumme Rohre“ mit klugen Endpoints als Message Broker Architektur
![Page 20: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/20.jpg)
!Wie müssen Microservices deployed werden?
Berücksichtige dabei Loose Kopplung!
![Page 21: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/21.jpg)
3 Deployment
Die typische Evolution einer Microservice Landschaft…
![Page 22: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/22.jpg)
µService
µService
t
![Page 23: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/23.jpg)
µService
µService
µService
µService
µService
µService
t
![Page 24: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/24.jpg)
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
t
![Page 25: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/25.jpg)
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
t
![Page 26: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/26.jpg)
HELP!
t
µService µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
![Page 27: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/27.jpg)
t
µService µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
µService
![Page 28: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/28.jpg)
!Vor der Einführung von Microservices MUSS man einen hohen Automatisierungs-Grad erreicht haben
![Page 29: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/29.jpg)
> Continuous Delivery
> Automatisierte Bereitstellung von Infrastruktur
> Automatisiertes Testing
![Page 30: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/30.jpg)
4 Collaboration
Sind Microservices das Wiederauferstehen der Spaghetti Integration?
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
![Page 31: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/31.jpg)
Hard wiring von Service-Endpoints funktioniert nicht in einer hoch
automatisierten Cloud-Landschaft
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
![Page 32: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/32.jpg)
Will man alle Microservices auf einer Maschine deployen?
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
![Page 33: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/33.jpg)
oder zieht man einen Host pro Microservice vor?
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
![Page 34: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/34.jpg)
Docker?
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
![Page 35: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/35.jpg)
Rollout einer neuen Version
AuthorService
EMail Service 1.0
![Page 36: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/36.jpg)
Rollout einer neuen Version
AuthorService
EMail Service 1.0
EMail Service1.1
![Page 37: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/37.jpg)
Rollout einer neuen Version
AuthorService
EMail Service 1.0
EMail Service1.1
Wie bekommt der AutorService nun den 1.1 Endpoint?
![Page 38: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/38.jpg)
Rollout einer neuen Version
AuthorService
EMail Service 1.0
EMail Service1.1
Wie bekommt der AutorService nun den 1.1 Endpoint?
![Page 39: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/39.jpg)
Rollout einer neuen Version
AuthorService
EMail Service 1.0
EMail Service1.1
Wie bekommt der AutorService nun den 1.1 Endpoint?
![Page 40: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/40.jpg)
Rollout einer neuen Version
AuthorService
EMail Service1.1
Wie bekommt der AutorService nun den 1.1 Endpoint?
![Page 41: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/41.jpg)
!Service Registries wie zB Netflix Eureka, Zookeeper, Kubernetes or Etcd helfen!
![Page 42: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/42.jpg)
5 Resilience
Die Fähigkeit eines Systems mit unerwarteten Ereignissen umzugehen • ohne dass es der User merkt • mit graceful service degradation
TAKEN FROM UWE FRIEDRICHSEN
![Page 43: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/43.jpg)
> Microservice Systeme sind komplex und zu einem hohen Grad verteilt
> Fehler passieren und sind nicht vorhersehbar
> Roll Forward ist wichtiger wie Roll Back
![Page 44: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/44.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
![Page 45: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/45.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
![Page 46: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/46.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
Wird langsamer und langsamer
![Page 47: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/47.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
Wird langsamer und langsamer
Thread Pool ist voll
![Page 48: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/48.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
Wird langsamer und langsamer
Thread Pool ist voll
Keine Requests zu anderen
Downstream Systemensind mehr möglich
![Page 49: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/49.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL
Wird langsamer und langsamer
Thread Pool ist voll
Eingehende Requests hängen
![Page 50: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/50.jpg)
!Führe eine Bulkhead und Circuit Breaker Komponente ein
![Page 51: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/51.jpg)
AuthorService
EMail Service Roles Service
THREAD POOL THREAD POOLBulkheads
Circuit Breakers
![Page 52: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/52.jpg)
Source: https://github.com/Netflix/Hystrix/wiki/How-it-Works https://github.com/Netflix/Hystrix/wiki/How-It-Works
Wie funktioniert Hystrix?
![Page 53: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/53.jpg)
6 Monitoring
Es ist wichtig, frühzeitig eine ganzheitliche Sicht auf das System zu bekommen
![Page 54: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/54.jpg)
> Es ist nicht ausreichend, jede Node einzeln zu monitoren
>Es muss gewährleistet sein, dass alle Logs / Statistiken von alles Nodes konsolidiert werden können
> Requests müssen an einer Stelle über das ganze System hinweg analysiert werden können
![Page 55: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/55.jpg)
Request Correlation IDs
AuthorService
EMail Service
Roles Service
OutBound Service
Print Service
Post Service
CID: 1502
CID: 1502
CID: 1502
CID: 1502
CID: 1502
CID: 1502
![Page 56: Anatomie von Microservice Landschaften](https://reader030.vdocuments.mx/reader030/viewer/2022032513/55d226ddbb61eb21438b473c/html5/thumbnails/56.jpg)
Herausforderung angenommen?
Business Design Deployment
Collabora-tionMonitoring
Interface Design
Resilience