Micro Services - Neither Micro Nor Service

52
Micro Services Neither Micro nor Service? Eberhard Wolff Freelancer Head Technology Advisory Board adesso AG http://ewolff.com

Transcript of Micro Services - Neither Micro Nor Service

Micro Services Neither Micro nor Service?

Eberhard Wolff Freelancer

Head Technology Advisory Board adesso AG

http://ewolff.com

Eberhard Wolff - @ewolff

Architecture of Enterprise

Java Apps

Eberhard Wolff - @ewolff

Eberhard Wolff - @ewolff

Eberhard Wolff - @ewolff

How can I implement a

new feature???

Eberhard Wolff - @ewolff L

Eberhard Wolff - @ewolff

ECommerce System

Spring & OSGi

New Stuff

Eberhard Wolff - @ewolff

New Stuff Spring & OSGi

New Stuff

ECommerce System

Eberhard Wolff - @ewolff

HTTP

New Stuff

Links

No legacy code Any technology

J Small code base

Little programs are delightful to write in

isolation, but the process of

maintaining large-scale software is always

miserable.

Jaron Lanier

Friedenspreis des deutschen Buchhandels

Eberhard Wolff - @ewolff

Micro Services: Definition •  Small •  Independent deployment units •  i.e. processes

•  Any technology •  Any infrastructure

Micro Service

Server

Micro Service

Server

Eberhard Wolff - @ewolff

Components Collaborate

Micro Service

Micro Service

Link

Data Replication

REST Messaging

Eberhard Wolff - @ewolff

Why Micro Services? •  Strong modularization •  Small deployment units •  Faster & easier deployment •  Continuous Delivery •  Less risk in deployment •  Choose best technology for each

service

Eberhard Wolff - @ewolff

Micro Service =

Micro?

Eberhard Wolff - @ewolff

10-100LOChttp://yobriefca.se/blog/ 2013/04/28/micro-service-architecture/

Smaller modules =better

Eberhard Wolff - @ewolff

10-100LOChttp://yobriefca.se/blog/ 2013/04/28/micro-service-architecture/

Smaller modules =better

Eberhard Wolff - @ewolff

Game of Life

Eberhard Wolff - @ewolff

life←{ ⍝ John Conway's "Game of Life". ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ ⍝ Expression for next generation. }

Game of Life in one line of APL

dyalog.com LOC is really a bad metric

Eberhard Wolff - @ewolff

Larger? •  Micro Services have an overhead

•  Build & deployment pipeline

•  Version control

Eberhard Wolff - @ewolff

1st Law of Distributed Objects •  Don’t Distribute Your Objects! •  Too much remote communication &

overhead •  Lesson learned from CORBA etc

•  http://martinfowler.com/bliki/FirstLaw.html

Eberhard Wolff - @ewolff

Request

Response

Processing

Latency Round Trip: 0,2-0,5 ms = 600.000-1.500.000 instructions@3GHz

Eberhard Wolff - @ewolff

1st Law of Distributed Objects & Micro Services

•  Small Micro Services mean a lot of communication

•  Violate the 1st Law •  Seems to work, though

•  http://martinfowler.com/articles/distributed-objects-microservices.html

Eberhard Wolff - @ewolff

Too small = too much

communication

Eberhard Wolff - @ewolff L

Eberhard Wolff - @ewolff

Again: Why Micro Services?

Eberhard Wolff - @ewolff

The main reason

Eberhard Wolff - @ewolff

How to scale agile?

Implement more feature

Eberhard Wolff - @ewolff

Conways Law

Architecture copies

communication structures of the organization

Eberhard Wolff - @ewolff

Conway’s Law as a Limit •  Won’t be able to create an

architecture different from your organization

•  I.e. mobile, GUI & database team •  Three technical artifacts

Eberhard Wolff - @ewolff

Conway’s Law as an Enabler •  Desired architecture =

project structure •  Team for each Micro Service •  Team should be responsible for

meaningful features •  Ideal: Independent features

Eberhard Wolff - @ewolff

On team can build and

deploy features –

independently!

Eberhard Wolff - @ewolff

Micro Services must provide a sensible set of functionality

Eberhard Wolff - @ewolff

Conway’s Law & Size •  Upper limit: What a (small) team

can handle

•  …and a meaningful set of features •  Probably not too small •  Lower limit: Depends on overhead /

technology

Eberhard Wolff - @ewolff

Micro Service = Micro? •  Size doesn’t matter too much

•  Teams must be able to work independently

•  Small enough for one team •  Not too much overhead

Eberhard Wolff - @ewolff

Micro Service =

Service?

Eberhard Wolff - @ewolff

Micro Services=

SOA?

Eberhard Wolff - @ewolff

Service? unassociated

loosely coupled units of functionality

that are self-contained (Wikipedia, SOA)

Eberhard Wolff - @ewolff

SOA

CRM Order

Service

Service

Service

Service

Service

Service

Service

Service

Portal / Web

Integration

Eberhard Wolff - @ewolff

SOA •  Enterprise wide effort •  Services provided by different

organizational units •  Large monolithic deployments •  …offer multiple services •  Enterprise-wide integration •  Portal / Web as universal GUI for all

services

Eberhard Wolff - @ewolff

SOA Service •  Just one interface of a large

monolith

•  No GUI

•  Different projects for different services

Eberhard Wolff - @ewolff

Micro Services CRM

Forecast

Mass EMailing

Reporting

Web Tracking

Integration

Eberhard Wolff - @ewolff

SOA vs. Micro Services •  Technology: Similar •  i.e. integration

•  But: Smaller deployment units

Eberhard Wolff - @ewolff

Micro Services just structure the application

Like JARs etc.

Eberhard Wolff - @ewolff

GUI for Micro Services •  Meaningful features will need a GUI •  Customer talks to one team for GUI

& logic •  Less communication •  1st Law of Distributed Objects

Eberhard Wolff - @ewolff

SOA •  Enterprise wide

effort •  Services provided

by different organizational units

•  Large monolithic deployments

•  …offer multiple services

•  Just one project

•  Services provided by one team

•  Small deployments •  …offer one service

each

Micro Services

Eberhard Wolff - @ewolff

SOA •  Enterprise wide

integration

•  Portal / Web as universal GUI for all services

•  Just one project •  Each

component has its own GUI

Micro Services

Eberhard Wolff - @ewolff

Conclusion

Eberhard Wolff - @ewolff

Conclusion: Micro Services •  Micro Services are a new way of

modularization •  More technological freedom •  Easier, faster and less risky

deployment

Eberhard Wolff - @ewolff

Conclusion: Micro •  Size not too important

•  Meaningful set of features

•  Smaller than SOA services

Eberhard Wolff - @ewolff

Conclusion: Service •  Modules of an application •  Include GUI •  Provide not just an interface to call

•  Structure one project •  …not the Enterprise IT

Eberhard Wolff - @ewolff

Thank You!