Architecture Anti-Patterns
Recognize and avoid common architectural mistakes that lead to fragility, complexity, or failure.
Context
You are reviewing an architecture and want to spot common anti-patterns. Patterns of failure repeat across organizations. Learn them, recognize them, guide teams away from them.
Domain Context
Based on architecture and design anti-patterns research:
- God Object: One class/service responsible for too much. Hard to change, test, understand.
- Big Ball of Mud: No clear architecture. Code accretion with no structure. Hard to modify without breaking things.
- Circular Dependency: A depends on B, B depends on A. Can't use A without B, vice versa. Breaks modularity.
- Database as Integration Point: Services share database schema. Schema changes break all services. No independence.
- Premature Optimization: Design for 10x scale when you have 1x. Overcomplex, unmaintainable.
Instructions
Common Anti-Patterns and Recognition:
- Monolith Bloat: Hundreds of thousands of lines in one service. Deploys take 30 min. Hard to test. Fix: decompose into services by business domain.
- Tight Coupling: Service A calls Service B calls Service C synchronously. Cascade failure: A down → B unavailable → C affected. Fix: async, timeouts, circuit breakers, fallbacks.
- No Logging/Monitoring: Don't know what's happening in production. Outage takes hours to debug. Fix: structured logging, metrics, distributed tracing, alerts.
- Cache Invalidation Chaos: Cache stale data, inconsistency everywhere. Fix: cache strategy with TTL, event-driven invalidation, don't cache mutable shared state.
- N+1 Query Problem: Loop calls database for each item. 1000 items = 1000 queries. Fix: batch queries, join tables, fetch aggregates.
Diagnose When Present:
- Performance issues in service you don't touch? Likely tight coupling or cascade failure.
- Hard to understand request path? Likely circular dependencies or god objects.
- Frequent outages from unrelated changes? Likely shared database or tight coupling.
Guide Teams Away:
- "I'm seeing patterns here that might make this hard to evolve. Let's consider [alternative]."
- Show concrete consequences: "Shared database means we can't deploy Customer service without coordinating with Order service."
Anti-Patterns of Anti-Pattern Avoidance
- Over-Applying Patterns: Every design must be microservices, event-driven, etc. Result: overengineering. Guard: Patterns are tools; choose based on problem, not pattern preference.
- Learning Too Late: Hit anti-pattern, then refactor. Result: wasted effort, technical debt. Guard: Recognize early; course-correct before pattern takes root.
- Ignoring Team Capabilities: Apply advanced pattern (CQRS, event sourcing) without team expertise. Result: bugs, performance issues. Guard: Match pattern to team skill; invest in learning.
Further Reading
- AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis by William H. Brown et al. — comprehensive anti-patterns
- Building Microservices by Sam Newman — anti-patterns in microservice design
- Release It! by Michael Nygard — production anti-patterns
1---2name: architecture-anti-patterns3description: Identify and avoid common architectural mistakes. Recognize patterns of failure. Use when reviewing designs or learning from mistakes.4---56# Architecture Anti-Patterns78Recognize and avoid common architectural mistakes that lead to fragility, complexity, or failure.910## Context1112You are reviewing an architecture and want to spot common anti-patterns. Patterns of failure repeat across organizations. Learn them, recognize them, guide teams away from them.1314## Domain Context1516Based on architecture and design anti-patterns research:1718- **God Object**: One class/service responsible for too much. Hard to change, test, understand.19- **Big Ball of Mud**: No clear architecture. Code accretion with no structure. Hard to modify without breaking things.20- **Circular Dependency**: A depends on B, B depends on A. Can't use A without B, vice versa. Breaks modularity.21- **Database as Integration Point**: Services share database schema. Schema changes break all services. No independence.22- **Premature Optimization**: Design for 10x scale when you have 1x. Overcomplex, unmaintainable.2324## Instructions25261. **Common Anti-Patterns and Recognition**:27 - **Monolith Bloat**: Hundreds of thousands of lines in one service. Deploys take 30 min. Hard to test. Fix: decompose into services by business domain.28 - **Tight Coupling**: Service A calls Service B calls Service C synchronously. Cascade failure: A down → B unavailable → C affected. Fix: async, timeouts, circuit breakers, fallbacks.29 - **No Logging/Monitoring**: Don't know what's happening in production. Outage takes hours to debug. Fix: structured logging, metrics, distributed tracing, alerts.30 - **Cache Invalidation Chaos**: Cache stale data, inconsistency everywhere. Fix: cache strategy with TTL, event-driven invalidation, don't cache mutable shared state.31 - **N+1 Query Problem**: Loop calls database for each item. 1000 items = 1000 queries. Fix: batch queries, join tables, fetch aggregates.32332. **Diagnose When Present**:34 - Performance issues in service you don't touch? Likely tight coupling or cascade failure.35 - Hard to understand request path? Likely circular dependencies or god objects.36 - Frequent outages from unrelated changes? Likely shared database or tight coupling.37383. **Guide Teams Away**:39 - "I'm seeing patterns here that might make this hard to evolve. Let's consider [alternative]."40 - Show concrete consequences: "Shared database means we can't deploy Customer service without coordinating with Order service."4142## Anti-Patterns of Anti-Pattern Avoidance4344- **Over-Applying Patterns**: Every design must be microservices, event-driven, etc. Result: overengineering. **Guard**: Patterns are tools; choose based on problem, not pattern preference.45- **Learning Too Late**: Hit anti-pattern, then refactor. Result: wasted effort, technical debt. **Guard**: Recognize early; course-correct before pattern takes root.46- **Ignoring Team Capabilities**: Apply advanced pattern (CQRS, event sourcing) without team expertise. Result: bugs, performance issues. **Guard**: Match pattern to team skill; invest in learning.4748## Further Reading4950- _AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis_ by William H. Brown et al. — comprehensive anti-patterns51- _Building Microservices_ by Sam Newman — anti-patterns in microservice design52- _Release It!_ by Michael Nygard — production anti-patterns