Veblen (1898) - Why is Economics Not an Evolutionary Science
Evolutionary Software Architecture, Why and How?
Transcript of Evolutionary Software Architecture, Why and How?
Evolutionary Software Architecture
DevTernityDec 1st 2015, Riga
Outline
• Is software development immature?
• Why do you need evolutionary architecture?
• How do you achieve that?
Is Software Industry Doomed?
Let’s talk about construction architecture
Is it so much different from software architecture?
Construction ProcessTraditional construction industry still
follows waterfall methodology
design estimate build deploy
What about software?
design estimate build deploy
Simply does not work, lets learn why
What is Design?
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
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
Code == Design
www.developerdotstar.com/mag/articles/reeves_design.html
In Software Engineering
not UML diagrams
Cost of Change
• Cost of change is exponential for
• construction projects
• waterfall software project with rigid architecture and bad code
Evolutionary Architecture is all about minimising
cost of changes
http://www.ibm.com/developerworks/library/j-eaed1/
Reasons for Evolutionary Architecture
Business Reasons
• Every IT system has its purpose
• replacing human at work
• increasing revenues
• gather confidential information
• other smart ways to help people
How much does it cost not having a feature?
Without new advertisement modulewe lose 10’000 EUR every month
It’s usually more efficient to rollout system gradually
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
Scalability Reasons
• Start small - growth later
• Familiar tools first - cool technology later
• Cloud first - dedicated data centre later
If architecture takes too much time, you will miss your targets
Evolving Your System, How it works?
Instead of designing your architecture upfront, apply
several approaches
Microservices
http://martinfowler.com/articles/microservices.html
Splitting your system into manageable, self-sufficient
services
http://microservices.io/
SOLID Principles
• Single-Responsibility Principle
• Open/Closed Principle
• Liskov Substitution Principle
• Interface segregation principle
• Dependency Inversion Principle
Relevant in OOP
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
“software entities … should be open for extension, but closed for
modification.”
microservices
Do not reuse microservice as code, rather as API
“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
many client-specific interfaces are better than one general-purpose interface.
services
services
Avoid mixing multiple sub-domains in one service
one should “Depend upon Abstractions. Do not depend upon
concretions”
Do not expose microservice internal data model
Microservices - treating your architecture as a set of
interconnected components
Monolithic System
Distributed System
Risk Management
• Microservices are isolated
• Mistakes in one service do not affect others
• technical debt
• design mistakes
• Microservices are replaceable
Communication
• Well defined APIs
• Event-based architecture
• Fallback strategies
• Runtime configuration
Microservices == SOA without rules!
Containers
http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/
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.
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
SOLID Containers• Single responsibility containers
• It is possible to extend containers
• Container interfaces are
• possible parameters
• shared folders
• inter-container links
Container Technology
• Revolutionary
• Isolating architectural components
• Supporting DevOps model
Test Automation
Test Automation Effects
• Increasing testing costs!
• Decreasing feedback cycles
Automated testing helps keeping hand on system pulse
Without that your system could be in clinical death
Testing Pyramid
http://martinfowler.com/articles/microservice-testing/
e2e
microservice
integration
System-wide tests
Integration between services
Service with stubs
Evolutionary development is not possible without test
automation
Databases
Previously
• Dedicated database admins
• All changes should be authorised
• Database has life on its own
• Lots of SQL scripts
Now
• Abstracting databases via service APIs
• Treated as a dumb storage
• All logic in service layer
• Multiple databases in one system
Summary
• Developer responsibility is shifting from code design to containers and APIs
• More things to learn, yay!
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
Evolutionary Architecture Traits
• Decreasing cost of change
• Decreasing feedback cycle time
• Increasing complexity
Recurring Patterns
• SOLID principles
• Well defined APIs
• Database agnostic
• Event-driven architecture
• Platform independent
• Containers, DevOps and automation
• 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!
The End