Slide 1

Slide 1 text

Beyond Microservices Eberhard Wolff @ewolff http://ewolff.com Fellow

Slide 2

Slide 2 text

http://continuous-delivery-buch.de/ http://continuous-delivery-book.com/

Slide 3

Slide 3 text

http://microservices-buch.de/ http://microservices-book.com/

Slide 4

Slide 4 text

http://microservices-book.com/ primer.html http://microservices-buch.de/ ueberblick.html FREE!!!!

Slide 5

Slide 5 text

http://microservices-praxisbuch.de/ rezepte.html FREE!!!! Print version at innoQ boot!

Slide 6

Slide 6 text

http://microservices-praxisbuch.de/ Soon…

Slide 7

Slide 7 text

What are Microservices?

Slide 8

Slide 8 text

Independent Systems Architecture: ISA Creator: INNOQ | http://isa-principles.org

Slide 9

Slide 9 text

Creator: INNOQ | http://isa-principles.org > Best practices > for microservices > for Self-contained Systems (SCS) http://scs-architecture.org Introduction Why ISA ? ! ! !

Slide 10

Slide 10 text

1 | Modules Creator: INNOQ | http://isa-principles.org

Slide 11

Slide 11 text

Creator: INNOQ | http://isa-principles.org > Modules: Old idea > Modularization for a system 1 | Modules

Slide 12

Slide 12 text

Creator: INNOQ | http://isa-principles.org > Reuse “Module” ideas: > High cohesion, low coupling, > Separation of concerns, > Single Responsibility … 1 | Modules

Slide 13

Slide 13 text

Creator: INNOQ | http://isa-principles.org > Modules provide interfaces > Access only through interface 1 | Modules

Slide 14

Slide 14 text

Creator: INNOQ | http://isa-principles.org > Information hiding > Microservice must not use other microservices’ internals (e.g. database schemas). 1 | Modules

Slide 15

Slide 15 text

2 | Container Creator: INNOQ / http://isa-principles.org

Slide 16

Slide 16 text

Creator: INNOQ | http://isa-principles.org > Modules = containers (or VMs, processes …) 2 | Container

Slide 17

Slide 17 text

3 | Macro / Micro Architecture Creator: INNOQ / http://isa-principles.org

Slide 18

Slide 18 text

Creator: INNOQ | http://isa-principles.org > Decisions for all modules 3 | Macro / Micro Architecture Macro Architecture

Slide 19

Slide 19 text

Creator: INNOQ | http://isa-principles.org > Decisions per module 3 | Macro / Miro Architecture Micro Architecture

Slide 20

Slide 20 text

Creator: INNOQ | http://isa-principles.org > All modules part of one system > Goal: Minimal Macro Architecture > Macro Architecture stable 3 | Macro / Miro Architecture Why Macro Architecture?

Slide 21

Slide 21 text

4 | Integration Creator: INNOQ | http://isa-principles.org

Slide 22

Slide 22 text

Creator: INNOQ | http://isa-principles.org > Integrate modules to become a system Synchronous, asynchronous, or UI 4 | Integration

Slide 23

Slide 23 text

5 | Communication Creator: INNOQ | http://isa-principles.org

Slide 24

Slide 24 text

Creator: INNOQ | http://isa-principles.org > Technical implementation > REST, messaging … 5 | Communication

Slide 25

Slide 25 text

6 | Independent Continuous Delivery Pipeline Creator: INNOQ | http://isa-principles.org

Slide 26

Slide 26 text

Creator: INNOQ | http://isa-principles.org > Microservices can only be deployed independently … > ... if pipelines are independent 6 | Independent Continuous Delivery Pipeline

Slide 27

Slide 27 text

7 | Standardize Operations Creator: INNOQ | http://isa-principles.org

Slide 28

Slide 28 text

Creator: INNOQ | http://isa-principles.org > Configuration, log analysis, tracing, monitoring, deployment > Reduce effort 7 | Standardize Operations

Slide 29

Slide 29 text

8 | Standards: Interface only Creator: INNOQ | http://isa-principles.org

Slide 30

Slide 30 text

Creator: INNOQ | http://isa-principles.org > Standardize e.g. configuration … or log interface > Do not standardize the library! 8 | Standards: Interface only

Slide 31

Slide 31 text

9 | Resilience Creator: INNOQ | http://isa-principles.org

Slide 32

Slide 32 text

Creator: INNOQ | http://isa-principles.org > Module still work … if other modules fail 9 | Resilience

Slide 33

Slide 33 text

Creator: INNOQ | http://isa-principles.org > Module still work … if moved somewhere else 9 | Resilience

Slide 34

Slide 34 text

Creator: INNOQ | http://isa-principles.org Independent System Architecture Container Modules Macro / Micro Architecture Independent Continuous Delivery Pipeline Resilience Integration Communication Standardized Operations Standards: Interface only

Slide 35

Slide 35 text

Why Microservices? !

Slide 36

Slide 36 text

Technological Benefits "

Slide 37

Slide 37 text

Decoupling > Originally: Changing a module does not influence other modules. > i.e. independent development

Slide 38

Slide 38 text

Microservice Decoupling > Independent scaling > Independent technical decisions > Decoupled crashes > Security: firewalls etc

Slide 39

Slide 39 text

Clean Architecture

Slide 40

Slide 40 text

Developer

Slide 41

Slide 41 text

Developer

Slide 42

Slide 42 text

REST REST

Slide 43

Slide 43 text

ECommerce System Order Catalog Billing Search

Slide 44

Slide 44 text

ECommerce System Order Catalog Billing Search

Slide 45

Slide 45 text

ECommerce System Catalog Billing Search

Slide 46

Slide 46 text

ECommerce System Order Catalog Billing Search Replace if messed up.

Slide 47

Slide 47 text

Replaceability > Small components hard to mess up > Each module can be replaced > …small green field project > ...different technology stack possible

Slide 48

Slide 48 text

Continuous Delivery

Slide 49

Slide 49 text

Microservices ECommerce System 3rd party systems Database

Slide 50

Slide 50 text

Microservices 3rd party systems Database Order Catalog Billing Search

Slide 51

Slide 51 text

Pipeline per Microservice

Slide 52

Slide 52 text

Build Pipeline for Microservices > Smaller > Easier to set up > Less features (3rd party systems) > Faster Feedback: Less tests

Slide 53

Slide 53 text

Decoupled Development Decoupled Scalability Decoupled Technical decisions Decoupled Crashes Security Architecture Firewalls Replaceability Continuous Delivery Technological Benefits

Slide 54

Slide 54 text

Organizational Benefits "

Slide 55

Slide 55 text

Deployment Monolith Stories Technical Coordination Coordinating Releases

Slide 56

Slide 56 text

Microservice Stories Technical Coordination Stories Technical Coordination Stories Technical Coordination Order Billing Search Release Release Release

Slide 57

Slide 57 text

Inverse Conway Maneuver > Architecture drives organization > Cross-functional team (database, logic, UI) > Team responsible for Bounded Context(s)

Slide 58

Slide 58 text

Take one huge project and make it several small projects…

Slide 59

Slide 59 text

Self-organization > With so much independence… > ...teams can decide for themselves.

Slide 60

Slide 60 text

Inverse Conway Maneuver Independent Technologies Independent Bounded Contexts Self- organization Organizational Benefits

Slide 61

Slide 61 text

Microservices: Challenges #

Slide 62

Slide 62 text

Consistency Order Invoice Delivery What about order #42? ✅ ✅ ❌

Slide 63

Slide 63 text

Consistency Order Invoice Delivery Order #42 is cancelled! ✅ ✅ ⁉ Goods might be delivered if order arrives after cancellation.

Slide 64

Slide 64 text

This is quite common without microservices.

Slide 65

Slide 65 text

Customer Order Catalog Domino Effect

Slide 66

Slide 66 text

Customer Order Catalog Domino Effect

Slide 67

Slide 67 text

Customer Order Catalog Domino Effect

Slide 68

Slide 68 text

Customer Order Catalog Domino Effect

Slide 69

Slide 69 text

Build resilient microservices!

Slide 70

Slide 70 text

Refactoring > Move code to a new service: Easy > Move code from service to service > Might be a port to a different language > Hard

Slide 71

Slide 71 text

Global Refactoring > Really hard: Global restructuring > i.e. moving everything to a different place. > …but that is always hard… > ...and the result of a major screw-up. > Do you want to optimize for this?

Slide 72

Slide 72 text

Many New Technologies > Microservices framework > Service discovery > Routing / API Gateway > Continuous Delivery pipeline > Docker > Docker scheduler (Kubernetes) > ....

Slide 73

Slide 73 text

Challenges Consistency Fail safeness Large scale refactoring New Technologies

Slide 74

Slide 74 text

Microservices are an all or nothing approach.

Slide 75

Slide 75 text

Microservices are an all or nothing approach. Too Monolithic!

Slide 76

Slide 76 text

Which benefits are important? Which challenges acceptable?

Slide 77

Slide 77 text

Moving beyond Microservices: Rightsize the Architecture!

Slide 78

Slide 78 text

Alternative Approaches

Slide 79

Slide 79 text

Centralized DB

Slide 80

Slide 80 text

Billing Order Process CRM Order Order Order True Microservices

Slide 81

Slide 81 text

Shared Database Order Schema Billing Order Process CRM

Slide 82

Slide 82 text

Modules -- Container ++ Independent Continuous Delivery Pipeline + Standardized Operations ++ Resilience - ISA Microservices

Slide 83

Slide 83 text

Decoupled Development -- Decoupled Scalability + Decoupled Technical decisions + Decoupled Crashes + Security - Architecture Firewalls - Replaceability -- Continuous Delivery - Technological Benefits

Slide 84

Slide 84 text

Inverse Conway Maneuver - Independent Technologies + Independent Bounded Contexts -- Self-organization - Organizational Benefits

Slide 85

Slide 85 text

Challenges Consistency ++ Fail safeness - Large scale refactoring - New Technologies + -

Slide 86

Slide 86 text

Centralized Database is a bad idea.

Slide 87

Slide 87 text

Consistency requires lots of compromises.

Slide 88

Slide 88 text

Layered

Slide 89

Slide 89 text

Layered iOS Android Web Order Product Delivery Invoice Customer Process Layer

Slide 90

Slide 90 text

Layered: Issues > Changing a business process cause many changes > …in frontends and many backends > Lots of communication between teams and components

Slide 91

Slide 91 text

Modules ++ Container ++ Independent Continuous Delivery Pipeline ++ Standardized Operations ++ Resilience + ISA Microservices

Slide 92

Slide 92 text

Decoupled Development - Decoupled Scalability - Decoupled Technical decisions ++ Decoupled Crashes + Security + Architecture Firewalls + Replaceability + Continuous Delivery - Technological Benefits

Slide 93

Slide 93 text

Inverse Conway Maneuver -- Independent Technologies ++ Independent Bounded Contexts -- Self-organization -- Organizational Benefits

Slide 94

Slide 94 text

Challenges Consistency + Performance -- Fail safeness -- Large scale refactoring -- New Technologies --

Slide 95

Slide 95 text

Layered: More challenges, less benefits, same effort

Slide 96

Slide 96 text

Microservices worsen the problems caused by strong coupling.

Slide 97

Slide 97 text

Bounded Context Microlith SCS

Slide 98

Slide 98 text

Order Shipping address Tracking # Items Item Categories Priority shipping Customs # Account # ... Credit card # Order #

Slide 99

Slide 99 text

My Domain Model is a mess!

Slide 100

Slide 100 text

Bounded Context > Domain model is only valid for one context > There is no universal data model! > See all failed SOA attempts

Slide 101

Slide 101 text

Order Shipping address Tracking # Items Item Categories Priority shipping Customs # Account # ... Credit card # Order # Customs Order Recommen- dations Order Tracking Order Shipping address Tracking # Item Categories Priority shipping Customs # Payment Order Account # Credit card #

Slide 102

Slide 102 text

Self-contained Systems Search Invoice Logistics Checkout Web Web Web Web See http://scs-architecture.org

Slide 103

Slide 103 text

Modules ++ Container ++ Independent Continuous Delivery Pipeline ++ Standardized Operations ++ Resilience + ISA Microservices

Slide 104

Slide 104 text

Decoupled Development ++ Decoupled Scalability ++ Decoupled Technical decisions ++ Decoupled Crashes ++ Security ++ Architecture Firewalls + Replaceability + Continuous Delivery ++ Technological Benefits

Slide 105

Slide 105 text

Inverse Conway Maneuver ++ Independent Technologies ++ Independent Bounded Contexts ++ Self-organization ++ Organizational Benefits

Slide 106

Slide 106 text

Challenges Consistency + Performance ++ Fail safeness ++ Large scale refactoring + New Technologies +

Slide 107

Slide 107 text

Microservices as they should be.

Slide 108

Slide 108 text

You still gain many benefits from Bounded Contexts in a Deployment Monolith.

Slide 109

Slide 109 text

Modules with Maven Architecture Management OSGi WAR

Slide 110

Slide 110 text

Build order / Architecture management Build order / Architecture management

Slide 111

Slide 111 text

Modules + Container -- Independent Continuous Delivery Pipeline - Standardized Operations ++ Resilience - ISA Microservices

Slide 112

Slide 112 text

Decoupled Development + Decoupled Scalability -- Decoupled Technical decisions -- Decoupled Crashes -- Security -- Architecture Firewalls ++ Replaceability + Continuous Delivery + Technological Benefits

Slide 113

Slide 113 text

Inverse Conway Maneuver + Independent Technologies -- Independent Bounded Contexts ++ Self-organization - Organizational Benefits

Slide 114

Slide 114 text

Challenges Consistency - Performance ++ Fail safeness - Large scale refactoring ++ New Technologies ++

Slide 115

Slide 115 text

Clean architecture with a lot less technical challenges!

Slide 116

Slide 116 text

Conclusion

Slide 117

Slide 117 text

Conclusion > Microservices: set of architecture decision > Independent System Architecture > Architecture is about trade-offs > Architecture is different for each project > Go beyond microservices by picking the best decisions! > …and gain most benefits

Slide 118

Slide 118 text

Usually bad tradeoffs > Centralized database > Layered model

Slide 119

Slide 119 text

Usually good tradeoffs > SCS, Bounded Context, Microlith > Bounded Context in a deployment monolith > Strongly separated modules in a deployment monolith

Slide 120

Slide 120 text

EMail [email protected] to get: Slides + Microservices Primer + Microservices Rezepte + Sample Microservices Book + Sample of Continuous Delivery Book Powered by Amazon Lambda & Microservices