self-contained systems: a different approach to microservices

62
Self-contained Systems: A Different Approach to Microservices

Upload: eberhard-wolff

Post on 06-Jan-2017

1.871 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Self-contained Systems: A Different Approach to Microservices

Self-contained Systems: A Different

Approach to Microservices

Page 2: Self-contained Systems: A Different Approach to Microservices

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

Page 3: Self-contained Systems: A Different Approach to Microservices

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

Page 4: Self-contained Systems: A Different Approach to Microservices

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

FREE!!!!

Page 5: Self-contained Systems: A Different Approach to Microservices

Microservice Definition

Page 6: Self-contained Systems: A Different Approach to Microservices

Server Server

Microservices: Definition

> Independent deployment units

> Any technology

> Any infrastructure

> UI + Logic

MicroService

MicroService

Page 7: Self-contained Systems: A Different Approach to Microservices

Components Collaborate

MicroService

MicroService

Link

Data Replication

REST

Messaging

Page 8: Self-contained Systems: A Different Approach to Microservices

Distributed System

Page 9: Self-contained Systems: A Different Approach to Microservices

Distributed SystemWhy??

Page 10: Self-contained Systems: A Different Approach to Microservices

Why Microservices?

Strong Modularization

Scaling Agile

Sustainable development Replaceable ServicesContinuous Delivery

Free choice of technology

Handle Legacy efficient

Independent Scaling

Robustness

Small teams develop and deploy independently

Add services – not code

Small Services

Failure limited to single Microservice

Page 11: Self-contained Systems: A Different Approach to Microservices

Why Microservices?Scaling Agile

Sustainable development

Continuous Delivery

Free choice of technology

Handle Legacy efficient

Independent Scaling

Robustness

Organization

DeploymentUnits

Technology

Page 12: Self-contained Systems: A Different Approach to Microservices

Single DeveloperScaling Agile

Sustainable development

Continuous Delivery

Free choice of technology

Handle Legacy efficient

Independent Scaling

Robustness

Organization

DeploymentUnits

Technology

Page 13: Self-contained Systems: A Different Approach to Microservices

Replace MonolithScaling Agile

Sustainable development

Continuous Delivery

Free choice of technology

Handle Legacy efficient

Independent Scaling

Robustness

Organization

DeploymentUnits

Technology

Page 14: Self-contained Systems: A Different Approach to Microservices

Layered

iOS Android Web

Order Search Catalog

BillingCustomer

Backend Backend Backend

Page 15: Self-contained Systems: A Different Approach to Microservices

Layered

> Reusable Backend Services

> Mobile client / Web App as frontend

> Backend for frontend (BFF): Custom backend services

> ...to implement frontend specific logic

> E.g. Netflix

Page 16: Self-contained Systems: A Different Approach to Microservices

Layered: Benefits

> Good way to build an API

> E.g. for mobile

> Might be easier to migrate into

> …if existing architecture is similar

Page 17: Self-contained Systems: A Different Approach to Microservices

Layered: Issues> BFF might contain the same logic –

same processes

> Processes are the most relevant logic

> Changing a business process cause changes in many services – BFF, Frontend, backend

> Lots of communication between teams and components

Page 18: Self-contained Systems: A Different Approach to Microservices

Self-contained Systems

Checkout Search BrowsingInvoicing

Web Web Web Web

Page 19: Self-contained Systems: A Different Approach to Microservices

Self-contained Systems (SCS)

> SCS: Autonomous web application

> Optional service API (e.g. for mobile clients)

> Includes data & logic

> Might contain several microservices

> No shared UI

> No shared business code

> E.g. Otto, Kaufhof, Kühne + Nagel ...

Page 20: Self-contained Systems: A Different Approach to Microservices

SCS: Benefits

> Business logic for one domain in one SCS

> Change usually local to one SCS

> Less communication between SCS

> I think this should be the goal

Page 21: Self-contained Systems: A Different Approach to Microservices

Self-Contained System (SCS)

Page 22: Self-contained Systems: A Different Approach to Microservices

Deploymentmonolith

Graphics by Roman Stranghöhner, innoQhttp://scs-architecture.org

Page 23: Self-contained Systems: A Different Approach to Microservices

Various Domains

Page 24: Self-contained Systems: A Different Approach to Microservices

User interfaceBusiness logicPersistence

Page 25: Self-contained Systems: A Different Approach to Microservices

… a lot of modules, components, frameworks and libraries

Page 26: Self-contained Systems: A Different Approach to Microservices

With all these layers in one place, a monolith tends to grow.

Page 27: Self-contained Systems: A Different Approach to Microservices

Cut Deploymentmonolith along domains …

Page 28: Self-contained Systems: A Different Approach to Microservices

… wrap domain in separate web application …

Page 29: Self-contained Systems: A Different Approach to Microservices

Self-contained System (SCS) –individuallydeployable

Page 30: Self-contained Systems: A Different Approach to Microservices

Decentralized unit communicating with other systems via RESTful HTTP or lightweight messaging.

Page 31: Self-contained Systems: A Different Approach to Microservices

SCS can be individually developed for different platforms.

Page 32: Self-contained Systems: A Different Approach to Microservices

An SCS contains its own user interface, specific business logic and separate data storage

Page 33: Self-contained Systems: A Different Approach to Microservices

Web user interface composed according to ROCA principles.

http://roca-style.org

Page 34: Self-contained Systems: A Different Approach to Microservices

optional API e.g. formobile

Page 35: Self-contained Systems: A Different Approach to Microservices

Logic only shared over a well defined interface.

Page 36: Self-contained Systems: A Different Approach to Microservices

Business logic can consist of microservices

Page 37: Self-contained Systems: A Different Approach to Microservices

Every SCS brings its own data storagewith ist own(potentiallyredundant) data

Page 38: Self-contained Systems: A Different Approach to Microservices

Redundancies:tolerable as long as sovereignty of databy owning system is not undermined.

Page 39: Self-contained Systems: A Different Approach to Microservices

Enables polyglot persistence

Neo4JCouchDB

Oracle

Page 40: Self-contained Systems: A Different Approach to Microservices

Technical decisions can be made independently from other systems(programming language, frameworks, tooling, platform)

Page 41: Self-contained Systems: A Different Approach to Microservices

Domain scope enables development, operation and maintenance of SCS by a single team.Team 1

Team 2 Team 3

Page 42: Self-contained Systems: A Different Approach to Microservices

Self-contained Systemsshould be integrated in the web interface

Page 43: Self-contained Systems: A Different Approach to Microservices

Hyperlinks to navigate between systems.

System 1 System 2

Page 44: Self-contained Systems: A Different Approach to Microservices

System 1 System 2

Redirection

> Use of callback URIs

> As seen e.g. in OAuth flows

Page 45: Self-contained Systems: A Different Approach to Microservices

Server-side integration

> Centralized aggregation

> Bottleneck (runtime/development time)

Browser

UI 1

UI 2

FrontendServer

Backend 1

Backend 2

Page 46: Self-contained Systems: A Different Approach to Microservices

https://github.com/ewolff/SCS-ESI

Page 47: Self-contained Systems: A Different Approach to Microservices

Client-side integration

> Proprietary integration

> Client requirements (e.g. CORS, JS)

> Upcoming: HMTL Imports

Browser

UI 1

UI 2

Backend 1

Backend 2

Page 48: Self-contained Systems: A Different Approach to Microservices

Client-side Integration: Code

$("a.embeddable").each(function(i, link) {

$("<div />").load(link.href, function(data, status, xhr) {

$(link).replaceWith(this);

});

});

> Replace <a href= " " class= "embeddable"> with content of document in a <div> (jQuery)

Page 49: Self-contained Systems: A Different Approach to Microservices

https://github.com/ewolff/SCS-jQuery

Page 50: Self-contained Systems: A Different Approach to Microservices

Synchronous remote calls inside the business logic should be avoided.

Page 51: Self-contained Systems: A Different Approach to Microservices

Asynchronous Remote calls reduce dependencies and prevent error cascades.

Page 52: Self-contained Systems: A Different Approach to Microservices

Data model’s consistency guarantees are relaxed.

Page 53: Self-contained Systems: A Different Approach to Microservices

An integrated system of systemslike this has many

benefits.

Page 54: Self-contained Systems: A Different Approach to Microservices

Resilience is improved through loosely

coupled, replaceable systems.

Page 55: Self-contained Systems: A Different Approach to Microservices

SCSs can be individually

scaled to serve varying demands.

Page 56: Self-contained Systems: A Different Approach to Microservices

No risky big bang to migrate an outdated, monolithic system into

a system of systems.

Version 1Version 2

Page 57: Self-contained Systems: A Different Approach to Microservices

Migration in small, manageable steps which minimize risk of failure and lead to

an evolutionary modernizationof big and complex systems.

Page 58: Self-contained Systems: A Different Approach to Microservices

1 *MicroserviceSCS

Page 59: Self-contained Systems: A Different Approach to Microservices

Conclusion

> SCS: autonomouos web application

> Might consist of Microservices

> Focus on UI Integration

> Almost completet independence

> Coarse-grained architecture approach

Page 60: Self-contained Systems: A Different Approach to Microservices

Conclusion

> Self-contained systems are Microservices …

> that are not “micro”…

> and don’t have to be “services”

> Many are doing it already!

Page 61: Self-contained Systems: A Different Approach to Microservices

> http://scs-architecture.org

> Creative commons

> Source on Github

> Slidedeck

Page 62: Self-contained Systems: A Different Approach to Microservices