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

Beyond Microservices

Jan 22, 2018

Download

Software

Eberhard Wolff
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Beyond Microservices

Beyond MicroservicesEberhard Wolff

@ewolffhttp://ewolff.com

Fellow

Page 2: Beyond Microservices

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

Page 3: Beyond Microservices

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

Page 4: Beyond Microservices

http://microservices-book.com/primer.html

http://microservices-buch.de/ueberblick.html

FREE!!!!

Page 5: Beyond Microservices

What are Microservices?

Page 6: Beyond Microservices

Modules ProcessesIndependent Continuous

Delivery Pipeline

Standardized Operations

Resilience

Microservices

Page 7: Beyond Microservices

Why Microservices?

!

Page 8: Beyond Microservices

Technological Benefits

"

Page 9: Beyond Microservices

Decoupling

> Originally: Changing a module does not influence other modules.

> i.e. independent development

Page 10: Beyond Microservices

Microservice Decoupling

> Independent scaling

> Independent technical decisions

> Decoupled crashes

> Security: firewalls etc

Page 11: Beyond Microservices

Clean Architecture

Page 12: Beyond Microservices

Developer

Page 13: Beyond Microservices

Developer

Page 14: Beyond Microservices

REST REST

Page 15: Beyond Microservices

ECommerceSystem

Order

Catalog

BillingSearch

Page 16: Beyond Microservices

ECommerceSystem

Order

Catalog

BillingSearch

Page 17: Beyond Microservices

ECommerceSystem

Catalog

BillingSearch

Page 18: Beyond Microservices

ECommerceSystem

Order

Catalog

BillingSearch

Replace if messed up.

Page 19: Beyond Microservices

Replaceability

> Small components hard to mess up

> Each module can be replaced

> …small green field project

> ...different technology stack possible

Page 20: Beyond Microservices

Continuous Delivery

Page 21: Beyond Microservices

Microservices

ECommerceSystem

3rd partysystems

Database

Page 22: Beyond Microservices

Microservices

3rd partysystems

Database

Order

Catalog

Billing

Search

Page 23: Beyond Microservices

Order

Billing

Customer

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Page 24: Beyond Microservices

Build Pipeline forMicroservices

> Build pipeline per Microservice

> Smaller

> Easier to set up

> Less features (3rd party systems)

> Faster Feedback: Less tests

Page 25: Beyond Microservices

Decoupled Development

Decoupled Scalability

Decoupled Technical decisions

Decoupled Crashes

SecurityArchitecture

Firewalls

ReplaceabilityContinuous

Delivery

Technological Benefits

Page 26: Beyond Microservices

Organizational Benefits

"

Page 27: Beyond Microservices

Deployment Monolith

Stories

Technical Coordination

Coordinating Releases

Page 28: Beyond Microservices

Microservice

Stories

TechnicalCoordination

Stories

TechnicalCoordination

Stories

TechnicalCoordination

Order Billing Search

Release Release Release

Page 29: Beyond Microservices

Inverse Conway Maneuver

> Architecture drives organization

> Cross-functional team (database, logic, UI)

> Team responsible for Bounded Context(s)

Page 30: Beyond Microservices

Take one huge project and make it several

small projects…

Page 31: Beyond Microservices

Self-organization

> With so much independence…

> ...teams can decide for themselves.

> Self-organization

Page 32: Beyond Microservices

Inverse Conway Maneuver

Independent Technologies

Independent Bounded Contexts

Self-organization

Organizational Benefits

Page 33: Beyond Microservices

Microservices: Challenges

#

Page 34: Beyond Microservices

Consistency

Order

Invoice

Delivery

What aboutorder #42?

Page 35: Beyond Microservices

Consistency

Order

Invoice

Delivery

Order #42is cancelled!

⁉Goods might be delivered

if order arrivesafter cancellation.

Page 36: Beyond Microservices

This is quite common without

microservices.

Page 37: Beyond Microservices

Customer Order Catalog

Domino Effect

Page 38: Beyond Microservices

Customer Order Catalog

Domino Effect

Page 39: Beyond Microservices

Customer Order Catalog

Domino Effect

Page 40: Beyond Microservices

Customer Order Catalog

Domino Effect

Page 41: Beyond Microservices

Build resilient microservices!

Page 42: Beyond Microservices

Refactorings

> Move code to a new service: Easy

> Move code from service to service

> Might be a port to a different language

> Hard

Page 43: Beyond Microservices

Global Refactorings

> Really hard: Global restructuring

> i.e. moving everything to a different place.

> …but that is always hard…

> ...and the result of a major screwup.

> Do you want to optimize for this?

Page 44: Beyond Microservices

Many New Technologies

> Microservices framework

> Service discovery

> Routing / API Gateway

> Continuous Delivery pipeline

> Docker

> Docker scheduler (Kubernetes)

> ....

Page 45: Beyond Microservices

Challenges

Consistency Fail safeness

Large scale refactoring

New Technologies

Page 46: Beyond Microservices

Microservices are an all or nothing

approach.

Page 47: Beyond Microservices

Microservices are an all or nothing

approach.

Page 48: Beyond Microservices

Which benefits are important?

Which challenges acceptable?

Page 49: Beyond Microservices

Moving beyond Microservices:Rightsize the achitecture!

Page 50: Beyond Microservices

Alternative Approaches

Page 51: Beyond Microservices

Centralized DB

Page 52: Beyond Microservices

Billing OrderProcess CRM

OrderOrder Order

True Microservices

Page 53: Beyond Microservices

Shared Database

Order Schema

Billing OrderProcess CRM

Page 54: Beyond Microservices

Modules--

Processes++

Independent Continuous

Delivery Pipeline+

Standardized Operations

-

Resilience-

Shared Database: Microservices

Page 55: Beyond Microservices

Decoupled Development

--

Decoupled Scalability

+

Decoupled Technical decisions

+

Decoupled Crashes

+

Security-

Architecture Firewalls

-

Replaceability--

Continuous Delivery

-

Technological Benefits

Page 56: Beyond Microservices

Inverse Conway Maneuver

-

Independent Technologies

+

Independent Bounded Contexts

--

Self-organization-

Organizational Benefits

Page 57: Beyond Microservices

Challenges

Consistency++

Fail safeness-

Large scale refactoring

-

New Technologies

-

-

Page 58: Beyond Microservices

Centralized Database is a bad idea.

Page 59: Beyond Microservices

Layered

Page 60: Beyond Microservices

Layered

iOS Android Web

Order Product Delivery

InvoiceCustomer

Page 61: Beyond Microservices

Layered: Issues

> Changing a business process cause many changes

> …in Frontend and many backend

> Lots of communication between teams and components

Page 62: Beyond Microservices

Modules

++

Processes

++

Independent Continuous

Delivery Pipeline

++

Standardized Operations

++

Resilience

+

Microservices

Page 63: Beyond Microservices

Decoupled Development

-

Decoupled Scalability

-

Decoupled Technical decisions

++

Decoupled Crashes+

Security+

Architecture Firewalls

+

Replaceability+

Continuous Delivery-

Technological Benefits

Page 64: Beyond Microservices

Inverse Conway Maneuver

--

Independent Technologies

++

Independent Bounded Contexts

--

Self-organization

--

Organizational Benefits

Page 65: Beyond Microservices

Challenges

Consistency

+

Performance

--

Fail safeness

--

Large scale refactoring

--

New Technologies

--

Page 66: Beyond Microservices

Layered:More challenges,

less benefits,same effort

Page 67: Beyond Microservices

Bounded ContextMicrolith

SCS

Page 68: Beyond Microservices

Order

Shipping addressTracking #ItemsItem CategoriesPriority shippingCustoms #Account #

...Credit card #

Order #

Page 69: Beyond Microservices

My Domain Model is a mess!

Page 70: Beyond Microservices

Bounded Context

> Domain model is only valid for one context

> There is no universal data model!

> See all failed SOA attempts

Page 71: Beyond Microservices

Order

Shipping addressTracking #ItemsItem CategoriesPriority shippingCustoms #Account #

...Credit card #

Order #

Customs

Order

Recommen-dations

Order

Tracking

Order

ShippingaddressTracking #

ItemCategories

Priorityshipping

Customs #

Payment

Order

Account #Credit card #

Page 72: Beyond Microservices

Self-contained Systems

Search Invoice LogisticsCheckout

Web Web Web Web

See http://scs-architecture.org

Page 73: Beyond Microservices

Modules

++

Processes

++

Independent Continuous

Delivery Pipeline

++

Standardized Operations

++

Resilience

+

Microservices

Page 74: Beyond Microservices

Decoupled Development

++

Decoupled Scalability

++

Decoupled Technical decisions

++

Decoupled Crashes

++

Security

++

Architecture Firewalls

+

Replaceability

+

Continuous Delivery

++

Technological Benefits

Page 75: Beyond Microservices

Inverse Conway Maneuver

++

Independent Technologies

++

Independent Bounded Contexts

++

Self-organization++

Organizational Benefits

Page 76: Beyond Microservices

Challenges

Consistency

+Performance

++Fail safeness

++

Large scale refactoring

+

New Technologies

+

Page 77: Beyond Microservices

Microservices as they should be.

Page 78: Beyond Microservices

Modules withMaven

Architecture ManagementOSGiWAR

Page 79: Beyond Microservices

Build order /Architecturemanagement

Build order /Architecturemanagement

Page 80: Beyond Microservices

Modules+

Processes--

Independent Continuous

Delivery Pipeline-

Standardized Operations

++

Resilience-

Microservices

Page 81: Beyond Microservices

Decoupled Development

+

Decoupled Scalability

--

Decoupled Technical decisions

--

Decoupled Crashes--

Security--

Architecture Firewalls

++

Replaceability+

Continuous Delivery+

Technological Benefits

Page 82: Beyond Microservices

Inverse Conway Maneuver

+

Independent Technologies

--

Independent Bounded Contexts

++

Self-organization-

Organizational Benefits

Page 83: Beyond Microservices

Challenges

Consistency-

Performance++

Fail safeness-

Large scale refactoring

++

New Technologies

++

Page 84: Beyond Microservices

Clean architecturewith a lot less

technical challenges!

Page 85: Beyond Microservices

Conclusion

Page 86: Beyond Microservices

Conclusion

> Microservices are a set of architecture decision

> Architecture is about trade-offs

> Architecture is different for each project

> Go beyond microservices by picking the best decisions!

> …and gain most benefits

Page 87: Beyond Microservices

Usually bad tradeoffs

> Centralized database

> Layered model

Page 88: Beyond Microservices

Usually good tradeoffs

> SCS, Bounded Context, Microlith

> Strongly separated modules