evolutionary software architecture, why and how?

61
Evolutionary Software Architecture DevTernity Dec 1st 2015, Riga

Upload: latcraft

Post on 13-Feb-2017

325 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Evolutionary Software Architecture, Why and How?

Evolutionary Software Architecture

DevTernityDec 1st 2015, Riga

Page 3: Evolutionary Software Architecture, Why and How?

Outline

• Is software development immature?

• Why do you need evolutionary architecture?

• How do you achieve that?

Page 4: Evolutionary Software Architecture, Why and How?

Is Software Industry Doomed?

Page 5: Evolutionary Software Architecture, Why and How?

Let’s talk about construction architecture

Page 6: Evolutionary Software Architecture, Why and How?

Is it so much different from software architecture?

Page 7: Evolutionary Software Architecture, Why and How?

Construction ProcessTraditional construction industry still

follows waterfall methodology

design estimate build deploy

Page 8: Evolutionary Software Architecture, Why and How?

What about software?

design estimate build deploy

Page 9: Evolutionary Software Architecture, Why and How?

Simply does not work, lets learn why

Page 10: Evolutionary Software Architecture, Why and How?

What is Design?

Page 11: Evolutionary Software Architecture, Why and How?

What does “Build” Mean?

Requirement Design Build Materials

Construction Drawings Engineering plans

Stick materials together

Lots of expensive

stuff

Software Specs Code Compile and package

A bit of electricity

Takes months

Takes minutes

Page 12: Evolutionary Software Architecture, Why and How?

Building House in Minutes

• What if you could build your home instantly with almost no cost?

• Iterative house development becomes possible

• You could walk in and say what you want to be changed

Page 13: Evolutionary Software Architecture, Why and How?

Code == Design

www.developerdotstar.com/mag/articles/reeves_design.html

In Software Engineering

not UML diagrams

Page 14: Evolutionary Software Architecture, Why and How?

Cost of Change

Page 15: Evolutionary Software Architecture, Why and How?

• Cost of change is exponential for

• construction projects

• waterfall software project with rigid architecture and bad code

Page 16: Evolutionary Software Architecture, Why and How?

Evolutionary Architecture is all about minimising

cost of changes

http://www.ibm.com/developerworks/library/j-eaed1/

Page 17: Evolutionary Software Architecture, Why and How?

Reasons for Evolutionary Architecture

Page 18: Evolutionary Software Architecture, Why and How?

Business Reasons

• Every IT system has its purpose

• replacing human at work

• increasing revenues

• gather confidential information

• other smart ways to help people

Page 19: Evolutionary Software Architecture, Why and How?

How much does it cost not having a feature?

Without new advertisement modulewe lose 10’000 EUR every month

Page 20: Evolutionary Software Architecture, Why and How?

It’s usually more efficient to rollout system gradually

Page 21: Evolutionary Software Architecture, Why and How?

Uncertainty

• We don’t know what users want

• Users don’t know what they want

• Only giving feature to users will give you enough data

• You have to gather such data as metrics

Page 22: Evolutionary Software Architecture, Why and How?

Scalability Reasons

• Start small - growth later

• Familiar tools first - cool technology later

• Cloud first - dedicated data centre later

Page 23: Evolutionary Software Architecture, Why and How?

If architecture takes too much time, you will miss your targets

Page 24: Evolutionary Software Architecture, Why and How?

Evolving Your System, How it works?

Page 25: Evolutionary Software Architecture, Why and How?

Instead of designing your architecture upfront, apply

several approaches

Page 26: Evolutionary Software Architecture, Why and How?

Microservices

Page 27: Evolutionary Software Architecture, Why and How?

http://martinfowler.com/articles/microservices.html

Page 28: Evolutionary Software Architecture, Why and How?

Splitting your system into manageable, self-sufficient

services

http://microservices.io/

Page 29: Evolutionary Software Architecture, Why and How?

SOLID Principles

• Single-Responsibility Principle

• Open/Closed Principle

• Liskov Substitution Principle

• Interface segregation principle

• Dependency Inversion Principle

Relevant in OOP

Page 30: Evolutionary Software Architecture, Why and How?

a class should have only a single responsibility (i.e. only one potential change in the software's specification

should be able to affect the specification of the class)

microservice

microservice

Design micro services according to bounded domains

Page 31: Evolutionary Software Architecture, Why and How?

“software entities … should be open for extension, but closed for

modification.”

microservices

Do not reuse microservice as code, rather as API

Page 32: Evolutionary Software Architecture, Why and How?

“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that

program.” See also design by contract.

microservices in a system

Try to design abstract APIs or use standard APIs

system

Page 33: Evolutionary Software Architecture, Why and How?

many client-specific interfaces are better than one general-purpose interface.

services

services

Avoid mixing multiple sub-domains in one service

Page 34: Evolutionary Software Architecture, Why and How?

one should “Depend upon Abstractions. Do not depend upon

concretions”

Do not expose microservice internal data model

Page 35: Evolutionary Software Architecture, Why and How?

Microservices - treating your architecture as a set of

interconnected components

Page 36: Evolutionary Software Architecture, Why and How?

Monolithic System

Page 37: Evolutionary Software Architecture, Why and How?

Distributed System

Page 38: Evolutionary Software Architecture, Why and How?

Risk Management

• Microservices are isolated

• Mistakes in one service do not affect others

• technical debt

• design mistakes

• Microservices are replaceable

Page 39: Evolutionary Software Architecture, Why and How?

Communication

• Well defined APIs

• Event-based architecture

• Fallback strategies

• Runtime configuration

Page 40: Evolutionary Software Architecture, Why and How?

Microservices == SOA without rules!

Page 41: Evolutionary Software Architecture, Why and How?

Containers

Page 42: Evolutionary Software Architecture, Why and How?

http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Page 43: Evolutionary Software Architecture, Why and How?

World Without Containers

• Can you change settings in Apache - No!

• Can you install latest Java - No!

• Can you upgrade Linux kernel - No!

• Can I get sudo access - of course not!

Reality - system admins don’t know anything about your system and they are afraid of you.

Page 44: Evolutionary Software Architecture, Why and How?

World With Containers

Here is a new container image version - make sure you run three of those at any given time - OK

Prerequisite: container platform up and running

Page 45: Evolutionary Software Architecture, Why and How?

SOLID Containers• Single responsibility containers

• It is possible to extend containers

• Container interfaces are

• possible parameters

• shared folders

• inter-container links

Page 46: Evolutionary Software Architecture, Why and How?

Container Technology

• Revolutionary

• Isolating architectural components

• Supporting DevOps model

Page 47: Evolutionary Software Architecture, Why and How?

Test Automation

Page 48: Evolutionary Software Architecture, Why and How?

Test Automation Effects

• Increasing testing costs!

• Decreasing feedback cycles

Page 49: Evolutionary Software Architecture, Why and How?

Automated testing helps keeping hand on system pulse

Without that your system could be in clinical death

Page 50: Evolutionary Software Architecture, Why and How?

Testing Pyramid

http://martinfowler.com/articles/microservice-testing/

e2e

microservice

integration

System-wide tests

Integration between services

Service with stubs

Page 51: Evolutionary Software Architecture, Why and How?

Evolutionary development is not possible without test

automation

Page 52: Evolutionary Software Architecture, Why and How?

Databases

Page 53: Evolutionary Software Architecture, Why and How?

Previously

• Dedicated database admins

• All changes should be authorised

• Database has life on its own

• Lots of SQL scripts

Page 54: Evolutionary Software Architecture, Why and How?

Now

• Abstracting databases via service APIs

• Treated as a dumb storage

• All logic in service layer

• Multiple databases in one system

Page 55: Evolutionary Software Architecture, Why and How?

Summary

Page 56: Evolutionary Software Architecture, Why and How?

• Developer responsibility is shifting from code design to containers and APIs

• More things to learn, yay!

Page 57: Evolutionary Software Architecture, Why and How?

Different Role for Architects

• Technical architect leading by example, but keeping overall picture

• If you see a UML diagram setting solution in stone - it is a problem

Page 58: Evolutionary Software Architecture, Why and How?

Evolutionary Architecture Traits

• Decreasing cost of change

• Decreasing feedback cycle time

• Increasing complexity

Page 59: Evolutionary Software Architecture, Why and How?

Recurring Patterns

• SOLID principles

• Well defined APIs

• Database agnostic

• Event-driven architecture

• Platform independent

• Containers, DevOps and automation

Page 60: Evolutionary Software Architecture, Why and How?

• Question: how to find a balance between up front and evolutionary architecture?

• Answer: you don’t, it only comes with experience

• Call craftsmen for help!

Page 61: Evolutionary Software Architecture, Why and How?

The End