software architecture for devops and continuous delivery

74
Software Architektur für DevOps und Continuous Delivery Eberhard Wolff Freelance Consultant / Trainer Head Technology Advisory Board adesso AG http://ewolff.com

Upload: eberhard-wolff

Post on 10-May-2015

3.804 views

Category:

Technology


4 download

DESCRIPTION

Talks from Continuous Lifecycle 2013 in Germany about the influence of DevOps and Continuous Delivery on Software Architecture,

TRANSCRIPT

Page 1: Software Architecture for DevOps and Continuous Delivery

Software Architektur für DevOps

und Continuous Delivery

Eberhard Wolff Freelance Consultant / Trainer

Head Technology Advisory Board adesso AG http://ewolff.com

Page 2: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 3: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 4: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

DevOps Development + Operations

=DevOps

Organizational change

No more silos

Page 5: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 6: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 7: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release

Page 8: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Continuous Delivery Needs Deployment

Automation •  But it is not the same

•  Many test systems required

•  Automation less error prone

Page 9: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Continuous Delivery Releases

•  Blue / Green Deployments •  New version on separate production

environment

•  Canary Releasing •  Release to a few servers in the

cluster

Page 10: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 11: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 12: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Architecture: Wikipedia Set of structures

needed to reason about the software system

Comprises software elements

relations between them properties of both

Page 13: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Why Architecture? •  System too large to understand

•  Understand components in isolation

•  Understand how components interact

Page 14: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Architecture & Non-functional Requirements

•  Architecture defines technical foundation

•  Technical foundation influences •  Performance •  Security •  Scalability •  Etc

Page 15: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 16: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Overview •  DevOps

•  Continuous Delivery

•  Architecture

•  7 Rules

Page 17: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Example

Order

Warehouse Customer

Functional decomposition Technology independent

Page 18: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Libraries e.g. jar, dll Method calls

One deployment unit

Page 19: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Architecture Simple

High performance

Page 20: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Change •  Modify order process slightly •  Customer & Warehouse unchanged

Order

Warehouse Customer

Database

Page 21: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Page 22: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release Order

Warehouse Customer

Database

Page 23: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Build Pipeline •  Just one component changed!

•  Lots of unneeded work

•  Takes much too long

Page 24: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Call Center Payment Provider

No retesting for new versions

Page 25: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Libraries e.g. jar, dll Method calls

One deployment unit

Page 26: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Services Service calls Three

deployment units

Page 27: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Components = Services •  Independent deployment

•  REST/JSON •  ProtoBuf •  MessageBus

•  Micro Services: even smaller?

Page 28: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Page 29: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release Order

Page 30: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Release •  Just a single component

•  Much easier to do Blue/Green •  or Canary Releases

•  Rollback of single service also easier

Page 31: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Other Benefits •  Might use different technologies per

component

•  For specific requirements

•  For specific developer skills

Page 32: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#1 Small Deployment Units Less testing

Faster deployment Less waste

Easier rollback

Page 33: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Change •  Optimized algorithm for warehouses

•  Additional information must be passed in from order

Page 34: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Interface changes Order must also be deployed

Page 35: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Problems •  Order and Warehouse must be

deployed together

•  Hard to coordinate

•  More complex pipeline •  Harder rollback

Page 36: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Solution •  New warehouse version supports

old interface

•  Warehouse can be deployed first •  …and then Order

•  Old interface must be phased out

Page 37: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Robustness Principle •  aka Postel’s Law •  Be conservative in what you send •  be liberal in what you accept •  e.g. accept calls to the old version of

the interface

•  Better interoperability

Page 38: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#2 Interface Backwards Compatibility

Faster deployment Deploy components independently

Less waste

Page 39: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Bug Fix Warehouse must be deployed again

Page 40: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Problems •  Warehouse stores current state in

RAM

•  Information lost during update

Page 41: Software Architecture for DevOps and Continuous Delivery

Stateless

Page 42: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Stateless •  Keep components stateless

•  Might store state in database etc.

Page 43: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#3 Stateless Easier to update

State e.g. in database

Page 44: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Component failure Domino effect

Page 45: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Component Interfaces •  Design for Failure •  I.e. do not fail if other component

fail

•  Default values •  Simpler algorithm •  Graceful Degradation

Page 46: Software Architecture for DevOps and Continuous Delivery

Architecture deals with

Failure

Page 47: Software Architecture for DevOps and Continuous Delivery

Resilience

Page 48: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Resilience & Small Deployment Units

•  Downtime during deployment might be acceptable

•  More flexibility for deployments

Page 49: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Circuit Breaker •  Do not call a broken system •  Instead throw exception •  Retry after some time

•  Protect broke system •  Do not call it in vain

Page 50: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#4 Design for Failure More stable

Better for Ops Better for new releases

Page 51: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Change •  SEPA

•  Additional customer information

Page 52: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Column must be added to database

Page 53: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Database Changes Are Hard •  Schema changes

•  Converting existing data •  Potential lots of data

•  Hard or even impossible to rollback

Page 54: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

1 - Keep database schema stable

2 - Database = component

Page 55: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Keep Database Schema Stable

•  Change database before components use it

•  Change database seldom •  i.e. schema changes not part of

deployment •  No rollback

Page 56: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#5a Keep database schema stable

No rollback Less agile

Page 57: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Databases = Component •  Support old “interface” •  i.e. schema

Page 58: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Order

Warehouse Customer

Database

Database must support different data structures

V42

V43

Page 59: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Dealing withDatabase Changes

•  Add an abstraction layer

•  Stored procedures •  No direct access to tables •  Persistence layer in the database •  Database is another component

with an API

Page 60: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Dealing withDatabase Changes

•  Support previous version schema

•  Default value for new columns •  Remove column only if not used

any more •  Use views •  …

Page 61: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#5b Databases = Component

Need to be backwards compatible Probably even more important than

for components

Page 62: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

NoSQL •  Schema changes much easier

•  Can support different schemas in parallel

•  Still need to convert data •  Same rules for compatibility apply

Page 63: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Change •  Support for new logistic partner

•  Won’t start until next month

Page 64: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Feature Branch •  Additional instance of the delivery

pipeline

•  Deployment must be synced to start of new partner

Page 65: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Feature Toggle

•  Implement the feature

•  Can be activated by feature toggle •  i.e. part of the configuration

Page 66: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Feature Toggle •  Implementation & deployment

independent •  Can deploy early – less risk •  Can evaluate in production •  A/B testing •  Slow ramp up possible •  Probably one toggle: Old / new

version

Page 67: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Feature Toggle •  Add another dimension to the

architecture

•  Must eventually be cleaned up

Page 68: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

DevOps •  Support for new logistics partner

crashes system

•  Feature toggle allows Ops to disable feature

•  One toggle per feature •  Resilience

Page 69: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#6 Feature Toggle Decouple release / new features

Resilience: Provide fallback

Page 70: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

After the Change •  New logistics partner

•  Revenue declined

•  Some orders were lost

Page 71: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Business Monitoring •  Provide metrics with business

meaning •  i.e. revenue •  #orders •  #registrations •  etc •  Feed into monitoring / metrics

Page 72: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

#7 Monitoring Dev provides (business) metrics

Ops provides monitoring infrastructure

Page 73: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

•  #1 Small Deployment Units •  #2 Interface Backwards

Compatibility •  #3 Stateless •  #4 Design For Failure •  #5a Keep database schema stable •  #5b Databases = Component •  #6 Feature Toggle •  #7 Monitoring

Page 74: Software Architecture for DevOps and Continuous Delivery

Eberhard Wolff - @ewolff

Thank You!