Software Architecture 
Anti-Patterns 
Eduards Sizovs 
eduards.sizovs@gmail.com 
@eduardsi
YAGNI Architecture
Story time
Some software is never intended to stand 
out from the crowd.
YAGNI KIND ASS Architecture
KEEP IT NEED DRIVEN AND SIMPLE, SIR
NEED-DRIVEN ?
NEED-DRIVEN ? 
REQUIREMENTS
NEED-DRIVEN ? 
REQUIREMENTS • RISKS
NEED-DRIVEN ? 
REQUIREMENTS • RISKS • CONSTRAINTS
Maslow's Hierarchy of Needs (of Software 
Development) 
http://gojko.net/2012/05/08/redefining-software-quality/
SIMPLE ?
Pick the tool you know well and ship the 
simplest possible solution.
Optimize for CHANGE.
Nano-Service Architecture 
When SOA goes wild.
You think that because you understand “one” that 
you must therefore understand “two” because one 
and one make two. But you forget that you must also 
understand “and.” 
— Sufi teaching story
By blindly splitting a system into "micro" services, you 
get all negative consequences with questionable 
benefits.
Micro Service-Oriented Architecture 
SIZE DOESN'T MATTER
Driving factors for decomposition
Driving factors for decomposition 
- Team boundaries
Driving factors for decomposition 
- Team boundaries 
- Frequency of change
Driving factors for decomposition 
- Team boundaries 
- Frequency of change 
- Different responsibilities
Driving factors for decomposition 
- Team boundaries 
- Frequency of change 
- Different responsibilities 
- Different (cross-functional) requirements
Driving factors for decomposition 
- Team boundaries 
- Frequency of change 
- Different responsibilities 
- Different (cross-functional) requirements 
- Different technical stack
Driving factors for decomposition 
- Team boundaries 
- Frequency of change 
- Different responsibilities 
- Different (cross-functional) requirements 
- Different technical stack 
- Prototyping / Experiments
Staying BIG is OK.
Structureless Architecture
Looks familiar?
Looks familiar? 
✗ reveal high-level components
Looks familiar? 
✗ reveal high-level components 
✗ reduce discovery cost
Looks familiar? 
✗ reveal high-level components 
✗ reduce discovery cost 
✗ improve comprehensibility
Looks familiar? 
✗ reveal high-level components 
✗ reduce discovery cost 
✗ improve comprehensibility 
✗ enable poka-yoke
What about this?
What about this? 
✔ reveal high-level components
What about this? 
✔ reveal high-level components 
✔ reduce discovery cost
What about this? 
✔ reveal high-level components 
✔ reduce discovery cost 
✔ improve comprehensibility
What about this? 
✔ reveal high-level components 
✔ reduce discovery cost 
✔ improve comprehensibility 
✔ enable poka-yoke
Apply micro service-oriented mindset to software 
structure. Keep services decoupled as if they were 
remote.
WHERE IS LAYERING?
Lasagna Architecture
Expected (doubtful) benefits from layering
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha) 
- Decoupling / abstracting for independent evolution (ha-ha)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha) 
- Decoupling / abstracting for independent evolution (ha-ha) 
- Decoupling for reuse (ha-ha)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha) 
- Decoupling / abstracting for independent evolution (ha-ha) 
- Decoupling for reuse (ha-ha) 
- Separation of concerns (is particular layer our concern?)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha) 
- Decoupling / abstracting for independent evolution (ha-ha) 
- Decoupling for reuse (ha-ha) 
- Separation of concerns (is particular layer our concern?) 
- Related stuff co-location (are DAOs really related?)
Expected (doubtful) benefits from layering 
- Ability to distribute your layers over multiple physical tiers (ha-ha) 
- Decoupling / abstracting for exhangeability (ha-ha) 
- Decoupling / abstracting for independent evolution (ha-ha) 
- Decoupling for reuse (ha-ha) 
- Separation of concerns (is particular layer our concern?) 
- Related stuff co-location (are DAOs really related?) 
- Constraint enforcement (is there a better way?)
Layering is your service's detail and is 
internal to the service.
Keep services mind-sized so there is no 
need for internal layering. Break services 
into tiny modules. 
(and consider keeping modules in separate VCS tree)
Undocumented Architecture
Working software over comprehensive 
documentation. 
(c) Agile Manifesto
Architecture is code! 
...but level of abstraction of code is negligible
I remember everything!
Code has hard time telling you about
Code has hard time telling you about 
- Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc.
Code has hard time telling you about 
- Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. 
- Significant Decisions and Agreements (e.g. rejected frameworks)
Code has hard time telling you about 
- Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. 
- Significant Decisions and Agreements (e.g. rejected frameworks) 
- Surroundings (Dependencies, Service Consumers)
Code has hard time telling you about 
- Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. 
- Significant Decisions and Agreements (e.g. rejected frameworks) 
- Surroundings (Dependencies, Service Consumers) 
- Onboarding (Source Repository, Building, QC, Deployment)
Code has hard time telling you about 
- Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. 
- Significant Decisions and Agreements (e.g. rejected frameworks) 
- Surroundings (Dependencies, Service Consumers) 
- Onboarding (Source Repository, Building, QC, Deployment) 
- Birdseye Technical View
"That’s the page I read that made the 
difference" 
is a great sanity check
UML vs C4 
Context, Containers, Components, Classes
http://static.codingthearchitecture.com/c4.pdf
Optimistic Architecture
Fault tolerance is a lesson best learned offline.
Raise and keep your hand if you know ->
Raise and keep your hand if you know -> 
What connection and thread pools does your application have
Raise and keep your hand if you know -> 
What connection and thread pools does your application have 
Approximate size
Raise and keep your hand if you know -> 
What connection and thread pools does your application have 
Approximate size 
Utilization during peak load
Raise and keep your hand if you know -> 
What connection and thread pools does your application have 
Approximate size 
Utilization during peak load 
When pools will approach the size limit
Raise and keep your hand if you know -> 
What connection and thread pools does your application have 
Approximate size 
Utilization during peak load 
When pools will approach the size limit 
How does your app behave when pools become full
Raise and keep your hand if you know -> 
What connection and thread pools does your application have 
Approximate size 
Utilization during peak load 
When pools will approach the size limit 
How does your app behave when pools become full 
How to timely react on it
What if an integration point will start to fail?
What if an integration point will start to fail? 
What if it will send slow response for 5+ minutes without failing?
What if an integration point will start to fail? 
What if it will send slow response for 5+ minutes without failing? 
What if it will send back huge 1GB result set?
What if an integration point will start to fail? 
What if it will send slow response for 5+ minutes without failing? 
What if it will send back huge 1GB result set? 
If your service fails, can others handle additional load they take?
What if an integration point will start to fail? 
What if it will send slow response for 5+ minutes without failing? 
What if it will send back huge 1GB result set? 
If your service fails, can others handle additional load they take? 
If your service fails, how far that failure reaches into app 
landscape?
What if an integration point will start to fail? 
What if it will send slow response for 5+ minutes without failing? 
What if it will send back huge 1GB result set? 
If your service fails, can others handle additional load they take? 
If your service fails, how far that failure reaches into app 
landscape? 
Can you switch off functionality that produces unexpectedly high 
load?
Timeouts
Timeouts 
Retries
Timeouts 
Retries 
Circuit Breakers
Timeouts 
Retries 
Circuit Breakers 
Bulkheads
Timeouts 
Retries 
Circuit Breakers 
Bulkheads 
Handshaking
Timeouts 
Retries 
Circuit Breakers 
Bulkheads 
Handshaking 
Leaky Bucket 
...
Alchemy Architecture
Wear software architect's hat by 
understanding and impacting current state 
of affairs.
Run short design sessions before diving into 
implementation.
Make sure architecture is VISIBLE for 
everyone.
Run weekly meetup on issues and plan how 
to get better in small steps.
Change the architecture with baby steps
Change the architecture with baby steps 
~ 45 minutes a day / person
Change the architecture with baby steps 
~ 45 minutes a day / person 
~ 4 hours a week / person
Change the architecture with baby steps 
~ 45 minutes a day / person 
~ 4 hours a week / person 
~ 20 hours a week / 5 people
Change the architecture with baby steps 
~ 45 minutes a day / person 
~ 4 hours a week / person 
~ 20 hours a week / 5 people 
No excuse for not starting tomorrow.
Software Architecture Essentials 
11th of March, 2015 
Register at www.craftsmans.lv
Software Architecture Anti-Patterns

Software Architecture Anti-Patterns

  • 1.
    Software Architecture Anti-Patterns Eduards Sizovs eduards.sizovs@gmail.com @eduardsi
  • 2.
  • 3.
  • 4.
    Some software isnever intended to stand out from the crowd.
  • 5.
    YAGNI KIND ASSArchitecture
  • 6.
    KEEP IT NEEDDRIVEN AND SIMPLE, SIR
  • 7.
  • 8.
  • 9.
  • 10.
    NEED-DRIVEN ? REQUIREMENTS• RISKS • CONSTRAINTS
  • 11.
    Maslow's Hierarchy ofNeeds (of Software Development) http://gojko.net/2012/05/08/redefining-software-quality/
  • 12.
  • 13.
    Pick the toolyou know well and ship the simplest possible solution.
  • 14.
  • 15.
  • 16.
    You think thatbecause you understand “one” that you must therefore understand “two” because one and one make two. But you forget that you must also understand “and.” — Sufi teaching story
  • 17.
    By blindly splittinga system into "micro" services, you get all negative consequences with questionable benefits.
  • 18.
  • 19.
    Driving factors fordecomposition
  • 20.
    Driving factors fordecomposition - Team boundaries
  • 21.
    Driving factors fordecomposition - Team boundaries - Frequency of change
  • 22.
    Driving factors fordecomposition - Team boundaries - Frequency of change - Different responsibilities
  • 23.
    Driving factors fordecomposition - Team boundaries - Frequency of change - Different responsibilities - Different (cross-functional) requirements
  • 24.
    Driving factors fordecomposition - Team boundaries - Frequency of change - Different responsibilities - Different (cross-functional) requirements - Different technical stack
  • 25.
    Driving factors fordecomposition - Team boundaries - Frequency of change - Different responsibilities - Different (cross-functional) requirements - Different technical stack - Prototyping / Experiments
  • 26.
  • 27.
  • 28.
  • 29.
    Looks familiar? ✗reveal high-level components
  • 30.
    Looks familiar? ✗reveal high-level components ✗ reduce discovery cost
  • 31.
    Looks familiar? ✗reveal high-level components ✗ reduce discovery cost ✗ improve comprehensibility
  • 32.
    Looks familiar? ✗reveal high-level components ✗ reduce discovery cost ✗ improve comprehensibility ✗ enable poka-yoke
  • 33.
  • 34.
    What about this? ✔ reveal high-level components
  • 35.
    What about this? ✔ reveal high-level components ✔ reduce discovery cost
  • 36.
    What about this? ✔ reveal high-level components ✔ reduce discovery cost ✔ improve comprehensibility
  • 37.
    What about this? ✔ reveal high-level components ✔ reduce discovery cost ✔ improve comprehensibility ✔ enable poka-yoke
  • 38.
    Apply micro service-orientedmindset to software structure. Keep services decoupled as if they were remote.
  • 39.
  • 40.
  • 41.
  • 42.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha)
  • 43.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha)
  • 44.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha) - Decoupling / abstracting for independent evolution (ha-ha)
  • 45.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha) - Decoupling / abstracting for independent evolution (ha-ha) - Decoupling for reuse (ha-ha)
  • 46.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha) - Decoupling / abstracting for independent evolution (ha-ha) - Decoupling for reuse (ha-ha) - Separation of concerns (is particular layer our concern?)
  • 47.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha) - Decoupling / abstracting for independent evolution (ha-ha) - Decoupling for reuse (ha-ha) - Separation of concerns (is particular layer our concern?) - Related stuff co-location (are DAOs really related?)
  • 48.
    Expected (doubtful) benefitsfrom layering - Ability to distribute your layers over multiple physical tiers (ha-ha) - Decoupling / abstracting for exhangeability (ha-ha) - Decoupling / abstracting for independent evolution (ha-ha) - Decoupling for reuse (ha-ha) - Separation of concerns (is particular layer our concern?) - Related stuff co-location (are DAOs really related?) - Constraint enforcement (is there a better way?)
  • 49.
    Layering is yourservice's detail and is internal to the service.
  • 50.
    Keep services mind-sizedso there is no need for internal layering. Break services into tiny modules. (and consider keeping modules in separate VCS tree)
  • 51.
  • 52.
    Working software overcomprehensive documentation. (c) Agile Manifesto
  • 53.
    Architecture is code! ...but level of abstraction of code is negligible
  • 54.
  • 55.
    Code has hardtime telling you about
  • 56.
    Code has hardtime telling you about - Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc.
  • 57.
    Code has hardtime telling you about - Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. - Significant Decisions and Agreements (e.g. rejected frameworks)
  • 58.
    Code has hardtime telling you about - Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. - Significant Decisions and Agreements (e.g. rejected frameworks) - Surroundings (Dependencies, Service Consumers)
  • 59.
    Code has hardtime telling you about - Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. - Significant Decisions and Agreements (e.g. rejected frameworks) - Surroundings (Dependencies, Service Consumers) - Onboarding (Source Repository, Building, QC, Deployment)
  • 60.
    Code has hardtime telling you about - Backups, Disaster Recovery, Redundancy, Failover, ETL, SLA, etc. - Significant Decisions and Agreements (e.g. rejected frameworks) - Surroundings (Dependencies, Service Consumers) - Onboarding (Source Repository, Building, QC, Deployment) - Birdseye Technical View
  • 61.
    "That’s the pageI read that made the difference" is a great sanity check
  • 62.
    UML vs C4 Context, Containers, Components, Classes
  • 63.
  • 64.
  • 65.
    Fault tolerance isa lesson best learned offline.
  • 66.
    Raise and keepyour hand if you know ->
  • 67.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have
  • 68.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have Approximate size
  • 69.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have Approximate size Utilization during peak load
  • 70.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have Approximate size Utilization during peak load When pools will approach the size limit
  • 71.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have Approximate size Utilization during peak load When pools will approach the size limit How does your app behave when pools become full
  • 72.
    Raise and keepyour hand if you know -> What connection and thread pools does your application have Approximate size Utilization during peak load When pools will approach the size limit How does your app behave when pools become full How to timely react on it
  • 74.
    What if anintegration point will start to fail?
  • 75.
    What if anintegration point will start to fail? What if it will send slow response for 5+ minutes without failing?
  • 76.
    What if anintegration point will start to fail? What if it will send slow response for 5+ minutes without failing? What if it will send back huge 1GB result set?
  • 77.
    What if anintegration point will start to fail? What if it will send slow response for 5+ minutes without failing? What if it will send back huge 1GB result set? If your service fails, can others handle additional load they take?
  • 78.
    What if anintegration point will start to fail? What if it will send slow response for 5+ minutes without failing? What if it will send back huge 1GB result set? If your service fails, can others handle additional load they take? If your service fails, how far that failure reaches into app landscape?
  • 79.
    What if anintegration point will start to fail? What if it will send slow response for 5+ minutes without failing? What if it will send back huge 1GB result set? If your service fails, can others handle additional load they take? If your service fails, how far that failure reaches into app landscape? Can you switch off functionality that produces unexpectedly high load?
  • 80.
  • 81.
  • 82.
  • 83.
    Timeouts Retries CircuitBreakers Bulkheads
  • 84.
    Timeouts Retries CircuitBreakers Bulkheads Handshaking
  • 85.
    Timeouts Retries CircuitBreakers Bulkheads Handshaking Leaky Bucket ...
  • 88.
  • 89.
    Wear software architect'shat by understanding and impacting current state of affairs.
  • 90.
    Run short designsessions before diving into implementation.
  • 91.
    Make sure architectureis VISIBLE for everyone.
  • 92.
    Run weekly meetupon issues and plan how to get better in small steps.
  • 93.
    Change the architecturewith baby steps
  • 94.
    Change the architecturewith baby steps ~ 45 minutes a day / person
  • 95.
    Change the architecturewith baby steps ~ 45 minutes a day / person ~ 4 hours a week / person
  • 96.
    Change the architecturewith baby steps ~ 45 minutes a day / person ~ 4 hours a week / person ~ 20 hours a week / 5 people
  • 97.
    Change the architecturewith baby steps ~ 45 minutes a day / person ~ 4 hours a week / person ~ 20 hours a week / 5 people No excuse for not starting tomorrow.
  • 98.
    Software Architecture Essentials 11th of March, 2015 Register at www.craftsmans.lv