69
Microservices: Architecture for Agile Soware Development Eberhard WolFellow, innoQ @ewol

Microservices: Architecture for Agile Software Development

Embed Size (px)

Citation preview

Page 1: Microservices: Architecture for Agile Software Development

Microservices: Architecture for Agile

Software Development Eberhard Wolff Fellow, innoQ

@ewolff

Page 2: Microservices: Architecture for Agile Software Development

http://microservices-buch.de/

Page 3: Microservices: Architecture for Agile Software Development

Code

Page 4: Microservices: Architecture for Agile Software Development

Microservice Definition

Page 5: Microservices: Architecture for Agile Software Development

Server Server

Microservices: Definition

>  Small

>  Independent deployment units

>  Any technology

>  Any infrastructure

>  UI + Logic

Micro Service

Micro Service

Page 6: Microservices: Architecture for Agile Software Development

Components Collaborate

Micro Service

Micro Service

Link

Data Replication

REST Messaging

Page 7: Microservices: Architecture for Agile Software Development

Online Shop

Order

Catalog

Search

Billing

Customer

HTML / HTTP

Page 8: Microservices: Architecture for Agile Software Development

Online Shop

Elasticsearch

Spring Batch Oracle

Spring MVC MongoDB

Order

Catalog

Search

Billing

Page 9: Microservices: Architecture for Agile Software Development

Agility

Page 10: Microservices: Architecture for Agile Software Development

Agile Manifesto >  Individuals and Interaction

>  Over processes and tools

>  Working Software

>  Over comprehensive documentation

>  Customer Collaboration

>  Over contract negotation

>  Responding to change

>  Over following a plan

Page 11: Microservices: Architecture for Agile Software Development

Agile Manifesto: Individuals and

Interactions

Page 12: Microservices: Architecture for Agile Software Development

Software Architecture & Individuals

Page 13: Microservices: Architecture for Agile Software Development

Software Architecture & Individuals

Unrelated?

Page 14: Microservices: Architecture for Agile Software Development

Does Your Architecture Take Individuals Into

Account?

Page 15: Microservices: Architecture for Agile Software Development

Conway‘s Law

Architecture copies

communication structures of the organization

Page 16: Microservices: Architecture for Agile Software Development

Conway‘s Law: Impact Architecture

and communication structures

in the organization are the same thing.

Page 17: Microservices: Architecture for Agile Software Development

Conway’s Law as a Limit

>  Organization drives architecture

>  I.e. GUI, logic & database team

>  Three technical artifacts

Page 18: Microservices: Architecture for Agile Software Development

GUI

Logic

DB

E Commerce Shop

Change Order

Process!

Page 19: Microservices: Architecture for Agile Software Development

time

DB Team Sprint

Logic Team Sprint

GUI Team Sprint

3 sprints

Page 20: Microservices: Architecture for Agile Software Development

Deployment Monolith

Deployment Monolith

Stories

Technical Coordination

Coordinating Releases

Page 21: Microservices: Architecture for Agile Software Development

Order Billing Search

Order Search Billing

Team for each business feature Let architecture drive the organization

Page 22: Microservices: Architecture for Agile Software Development

Deployment Monolith + Conway’s Law

Deployment Monolith

Stories

Technical Coordination

Coordinating Releases

StoriesStories

Order Billing Search

Page 23: Microservices: Architecture for Agile Software Development

Microservices + Conway’s Law

>  Let architecture drive the organization

>  Team for each Microservice

>  Team responsible for business features

>  Ideal: Independent features

Page 24: Microservices: Architecture for Agile Software Development

Order Billing Search

Order Search Billing

Team can deploy without integration Changes can be deployed independently & quickly

Strong & enforced modularization

Technology stack per Microservice One or many Microservices per Team

Synergy Microservices / Conway’s Law

Page 25: Microservices: Architecture for Agile Software Development

Microservices

Microservice

Stories

TechnicalCoordination

Microservice

Stories

TechnicalCoordination

Microservice

Stories

TechnicalCoordination

Order Billing Search

Release Release Release

Page 26: Microservices: Architecture for Agile Software Development

How to scale agile?

Page 27: Microservices: Architecture for Agile Software Development

Use a process to scale agile?

Page 28: Microservices: Architecture for Agile Software Development

Individuals & interaction

over

processes and tools

Page 29: Microservices: Architecture for Agile Software Development

Define architecture to limit

communication needs

Page 30: Microservices: Architecture for Agile Software Development

One team can build and deploy features independently!

Page 31: Microservices: Architecture for Agile Software Development

Team must be responsible for a sensible set of

functionality

Page 32: Microservices: Architecture for Agile Software Development

Less Technical Coordination

Page 33: Microservices: Architecture for Agile Software Development

Agile Manifesto: Working Software

Page 34: Microservices: Architecture for Agile Software Development

Scrum

>  PSI

>  Potentially shippable increment

>  Why?

Page 35: Microservices: Architecture for Agile Software Development

Principles behind the Agile Manifesto

Our highest priority is

to satisfy the customer

through early and

continuous delivery

of valuable software.

Page 36: Microservices: Architecture for Agile Software Development

Potentially Shippable Increment

Continuous Delivery

Page 37: Microservices: Architecture for Agile Software Development

Monolith

ECommerce System

3rd party systems

Database

Page 38: Microservices: Architecture for Agile Software Development

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release

ECommerce System

Page 39: Microservices: Architecture for Agile Software Development

Build Pipeline: Complex Infrastructure

>  Huge database

>  3rd party integration

Page 40: Microservices: Architecture for Agile Software Development

Build Pipeline: Slow Feedback

>  Slow feedback

>  Test everything for each commit

>  Huge deployment unit

>  Deployment slow

Page 41: Microservices: Architecture for Agile Software Development

Monolith: Deployment

>  Huge deployment

>  Risky

>  Hard to mitigate risk

>  Blue / Green: Create a separate environment

>  Canary: Deploy to one server first

Page 42: Microservices: Architecture for Agile Software Development

Microservices

ECommerce System

3rd party systems

Database

Order

Catalog

Billing Search

Page 43: Microservices: Architecture for Agile Software Development

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

Order

Billing

Customer

Page 44: Microservices: Architecture for Agile Software Development

Build Pipeline for Microservices

>  Independent deployment

>  Build pipeline per Microservice

>  Small

>  Easier to set up

>  Less features (3rd party systems)

>  Faster Feedback: Less tests

Page 45: Microservices: Architecture for Agile Software Development

Microservice: Deployment

>  Small deployment

>  Less risky

>  Other Microservices resilient to failing microservice

>  Easy to create new environments

>  E.g. for Blue / Green or Canary

Page 46: Microservices: Architecture for Agile Software Development

Quick Deployments Time

Size & Risk

Manual Deployment

Pipeline

Continuous Delivery Pipeline

Monolith Microservices

Page 47: Microservices: Architecture for Agile Software Development

Potentially shippable increment?

Page 48: Microservices: Architecture for Agile Software Development

SHIP!!!

Page 49: Microservices: Architecture for Agile Software Development

Agile Manifesto: Customer

Collaboration

Page 50: Microservices: Architecture for Agile Software Development

Customer Collaboration &

Architecture?

Page 51: Microservices: Architecture for Agile Software Development

Customer Collaboration &

Architecture? Not sure.

Page 52: Microservices: Architecture for Agile Software Development

Microservices & Departments

StoriesStories Stories

Customer Billing OrderProcess

ProductOwner

ProductOwner

ProductOwner

Department Department Department

Page 53: Microservices: Architecture for Agile Software Development

Microservices & Departments

>  Ideal: One team per department

>  Ideal: Change local to one team / Microservice

>  Otherwise: Coordination needed

Page 54: Microservices: Architecture for Agile Software Development

Customer should own Microservice

Page 55: Microservices: Architecture for Agile Software Development

Agile Manifesto: Responding to change

Page 56: Microservices: Architecture for Agile Software Development

Monoliths

>  Architecture rot

>  …not maintainable any more

>  …and can’t be rewritten / replaced

Page 57: Microservices: Architecture for Agile Software Development

Deployment Monolith

>  Cyclic dependency

>  …because the IDE suggested some class

>  Might not even be noticed

Module

Class

Module

Class

Class Class

Page 58: Microservices: Architecture for Agile Software Development

Microservices

>  Need to use the API

>  Different team

>  More effort - will think about it

>  Rot less likely

Microservice

Class

Microservice

Class

Class Class

Page 59: Microservices: Architecture for Agile Software Development

Global Refactorings?

>  Move code from service to service

>  Might be a port to a different language

>  Separate in a new service

>  Harder than in a Deployment Monolith

Page 60: Microservices: Architecture for Agile Software Development

Microservices

>  Small

>  Easy to change

>  Architectural problems in Microservice unlikely

>  Can be replaced

Microservice

Class

Class

Page 61: Microservices: Architecture for Agile Software Development

Microservices – Easy to Recylce

Page 62: Microservices: Architecture for Agile Software Development

Conclusion

Page 63: Microservices: Architecture for Agile Software Development

Conclusion: Microservices & Agility

>  Individuals over tools

>  Architecture drives organization

>  Scale by architecture not process

>  Working software

>  Actually ship software

>  Continuous Delivery

Page 64: Microservices: Architecture for Agile Software Development

Conclusion: Microservices & Agility

>  Customer collaboration

>  Customer should own services

>  i.e. organization beyond the project = architecture

Page 65: Microservices: Architecture for Agile Software Development

Conclusion: Microservices & Agility

>  Responding to change

>  Individual Microservices small

>  Easy to change

>  …and replace

>  Unwanted dependencies won’t sneak in

>  But: Global refactoring hard, too

Page 66: Microservices: Architecture for Agile Software Development

Meta-Conclusion

Page 67: Microservices: Architecture for Agile Software Development

How To Think About Architecture

>  Process has an impact on architecture

>  Software architecture & organization are the same

>  Build recyclable software!

Page 68: Microservices: Architecture for Agile Software Development

Microservice > Agile Achitecture

Strong Modularization

Scaled Agile Architecture

Sustainable development speed Replaceable Services

Continuous Delivery

Choose best technology for job!

Handle Legacy more efficient

Independent Scaling

Robustness

Page 69: Microservices: Architecture for Agile Software Development

Microservice Training

>  Stefan Tilkov / Eberhard Wolff

>  Frankfurt / Main

>  26.-27.10.2015

>  https://www.innoq.com/de/trainings/microservices-training/