![Page 1: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/1.jpg)
Evolutionary Software Architecture
DevTernityDec 1st 2015, Riga
![Page 3: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/3.jpg)
Outline
• Is software development immature?
• Why do you need evolutionary architecture?
• How do you achieve that?
![Page 4: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/4.jpg)
Is Software Industry Doomed?
![Page 5: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/5.jpg)
Let’s talk about construction architecture
![Page 6: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/6.jpg)
Is it so much different from software architecture?
![Page 7: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/7.jpg)
Construction ProcessTraditional construction industry still
follows waterfall methodology
design estimate build deploy
![Page 8: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/8.jpg)
What about software?
design estimate build deploy
![Page 9: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/9.jpg)
Simply does not work, lets learn why
![Page 10: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/10.jpg)
What is Design?
![Page 11: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/11.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/12.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/13.jpg)
Code == Design
www.developerdotstar.com/mag/articles/reeves_design.html
In Software Engineering
not UML diagrams
![Page 14: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/14.jpg)
Cost of Change
![Page 15: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/15.jpg)
• 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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/16.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/17.jpg)
Reasons for Evolutionary Architecture
![Page 18: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/18.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/19.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/20.jpg)
It’s usually more efficient to rollout system gradually
![Page 21: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/21.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/22.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/23.jpg)
If architecture takes too much time, you will miss your targets
![Page 24: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/24.jpg)
Evolving Your System, How it works?
![Page 25: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/25.jpg)
Instead of designing your architecture upfront, apply
several approaches
![Page 26: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/26.jpg)
Microservices
![Page 27: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/27.jpg)
http://martinfowler.com/articles/microservices.html
![Page 28: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/28.jpg)
Splitting your system into manageable, self-sufficient
services
http://microservices.io/
![Page 29: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/29.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/30.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/31.jpg)
“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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/32.jpg)
“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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/33.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/34.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/35.jpg)
Microservices - treating your architecture as a set of
interconnected components
![Page 36: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/36.jpg)
Monolithic System
![Page 37: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/37.jpg)
Distributed System
![Page 38: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/38.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/39.jpg)
Communication
• Well defined APIs
• Event-based architecture
• Fallback strategies
• Runtime configuration
![Page 40: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/40.jpg)
Microservices == SOA without rules!
![Page 41: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/41.jpg)
Containers
![Page 42: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/42.jpg)
http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/
![Page 43: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/43.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/44.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/45.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/46.jpg)
Container Technology
• Revolutionary
• Isolating architectural components
• Supporting DevOps model
![Page 47: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/47.jpg)
Test Automation
![Page 48: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/48.jpg)
Test Automation Effects
• Increasing testing costs!
• Decreasing feedback cycles
![Page 49: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/49.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/50.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/51.jpg)
Evolutionary development is not possible without test
automation
![Page 52: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/52.jpg)
Databases
![Page 53: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/53.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/54.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/55.jpg)
Summary
![Page 56: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/56.jpg)
• Developer responsibility is shifting from code design to containers and APIs
• More things to learn, yay!
![Page 57: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/57.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/58.jpg)
Evolutionary Architecture Traits
• Decreasing cost of change
• Decreasing feedback cycle time
• Increasing complexity
![Page 59: Evolutionary Software Architecture, Why and How?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/59.jpg)
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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/60.jpg)
• 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?](https://reader031.vdocuments.site/reader031/viewer/2022022123/58a0f0331a28abad6d8b65f5/html5/thumbnails/61.jpg)
The End