Source
Evolutionary architecture in practice
Report summary: incrementality, fitness functions and coupling.
Evolutionary architecture is a practical way to manage the inevitable changes as the product grows, the team scales, and architectural decisions begin to impact the speed and quality of delivery.
Context: why the topic arises
Drivers of change
- Growth in customers and product lines increases the cost of change.
- More integrations between products → more dependencies and organizational complexity.
- Teams are divided into stream-aligned, the architecture follows the organizational structure (Conway's law).
Key Idea
Architecture should help change, and not turn into a stopping factor. Evolutionary architecture is about quality management in conditions of constant change.
What is architecture in this topic
Architecture as a set of important decisions
Decisions that are difficult and expensive to change, so they need to be made consciously.
Architecture as boundaries and trajectory
Determines not only the current device, but also the direction of development of the system.
What does "evolutionary" mean?
Video
Report: Evolutionary architecture in practice
Tinkoff Agile Conference 2021, Alexander Polomodov.
Incrementality
Small steps are easier to build, test and roll out.
Controllability
Changes must remain within specified quality boundaries.
Incrementality gives profit
- Build: Small changes are easier to implement and test.
- Deploy: Smaller deliveries are safer and roll out faster.
- Product: it’s easier to map business features onto architecture.
Three blocks of evolutionary architecture
Book
Building Evolutionary Architectures
Fitness functions, architectural quantum and the practice of architecture evolution.
Incremental Changes
We build the system so that changes are made small and frequent.
Fitness functions
Automated checks that keep your architecture in line.
Appropriate coupling
The connectivity between components allows them to evolve independently.
Visual evolution map
Flow of changes
Incremental Changes
Small changes are easier to make, test and roll out.
Fitness functions
Checks that maintain quality and limits.
Appropriate coupling
The components change independently, without a domino effect.
Formula
Incrementality + controllability
Without controllability, increments turn into spaghetti.
Guardrails
Incremental changes: yes, but...
Uncontrolled iterations turn the system into “spaghetti” - both at the code level and at the level of integrations between services. This is acceptable for a prototype, but the combat system requires frameworks.
Fitness functions and architectural characteristics
What is it
Architectural fitness function is a measurable test that confirms that the system remains suitable for changes within specified limits.
Characteristics
How to build frames
- Define architectural characteristics (…ility).
- Assign priorities and acceptable budgets.
- Translate budgets into tests, metrics, inspections.
- Automate and run in CI (each PR).
Tools from the report
- ArchUnit - architectural rules through unit tests (Java)
- Danger - automation of code review checks in CI
- Fitv / Fitness Validator - an internal tool for monitoring rules and technical debt
Coupling: how components “evolve”
Book
Clean Architecture
Principles of stability and abstraction for the evolution of components.
Stable Dependencies Principle (SDP)
Dependencies are directed towards more stable components.
Stable Abstraction Principle (SAP)
A component must be as abstract as it is stable.
Stability metrics
Ce - outgoing dependencies, Ca - incoming dependencies.
Main Sequence
Zone of Pain
Stable but specific components are painful to expand.
The Main Sequence
The balance of stability and abstraction is a healthy zone.
Zone of Uselessness
Unstable abstractions that no one uses.
When is it time to evolve?
Too much software for one team
The team does not keep the entire context - the number of manual agreements increases.
Delivery speed problems
Lead time increases, the share of blocking between teams increases.
Excessive cognitive complexity
Systems and processes require too much context to operate.
Architectural changes and team changes are connected: according to Conway's law, systems reflect the communications and structure of the organization.
What's next
- First, fix architectural characteristics and budgets.
- Add fitness functions to CI and team culture.
- Regularly review coupling and monitor Main Sequence.
- To go deeper: "Building Evolutionary Architectures" and "Clean Architecture".Read review
