Software Architecture Patterns
Overview
Architecture patterns are reusable, named solutions to recurring structural problems — how to separate concerns, communicate between components, and contain failure. Each pattern solves one problem and introduces trade-offs, so choose by the problem you face, not the technology you want. Read this when structuring a new service or evaluating a refactor.
Official sources
Core concepts
- Layered (Presentation–Domain–Data): separate the UI, business logic, and data-access concerns so each can change independently; the dominant default for most applications.
- Hexagonal / Ports & Adapters: isolate the domain core behind explicit ports, with adapters for UI, persistence, and external systems, so infrastructure is swappable and the core is testable.
- Event-driven architecture: components communicate by emitting and reacting to events (often via Publisher-Subscriber), decoupling producers from consumers in time and identity.
- Microservices: develop a single application as a suite of small services, each in its own process, communicating over lightweight mechanisms — independently deployable but distributed.
- Cloud design patterns: technology-agnostic solutions (Circuit Breaker, Retry, Cache-Aside, CQRS, Saga, Bulkhead, Strangler Fig) that address reliability, scale, and integration in distributed systems.
- Patterns are composable: real workloads apply several together (e.g. Retry + Circuit Breaker; Queue-Based Load Leveling + Competing Consumers).
Best practices
- Choose a pattern from the problem and acceptable trade-offs, not from the technology — the Azure catalog explicitly advises starting from a constraint or risk in the workload.
- Default to a well-structured monolith with clear layering; adopt microservices only when team/scale boundaries justify the distributed-systems cost.
- Pair resilience patterns: combine Retry with Circuit Breaker so transient faults are retried but persistent faults stop hammering a failing dependency.
- Use the Strangler Fig pattern to migrate legacy systems incrementally instead of a risky big-bang rewrite.
Common pitfalls
- Adopting microservices for a small team or early product → you inherit network, consistency, and ops overhead without the scale benefit; keep a modular monolith until boundaries are clear.
- Believing distributed systems are reliable, low-latency, and infinitely scalable (the fallacies of distributed computing) → design compensations (timeouts, retries, idempotency) for each fallacy.
- Treating an antipattern as a pattern because it works at low load → re-evaluate designs that degrade as traffic grows.
Examples
Resilient remote call (Azure pattern combo):
client -> [Retry with backoff] -> [Circuit Breaker] -> remote service
- Retry handles transient faults.
- Circuit Breaker opens after repeated failures, failing fast and shedding load.
Further reading
Related skills
- ../message-queues-async — event-driven and async messaging foundations
- ../scalability-reliability — resilience patterns under load
- ../api-design-rest-graphql — designing the interfaces between services
1---2name: software-architecture-patterns3description: Layered, hexagonal, event-driven, and microservices patterns plus cloud design patterns; read when choosing or structuring application architecture.4domain: engineering5category: architecture6tags: [architecture-patterns, microservices, event-driven, layered, cloud-patterns]7official_sources:8 - https://martinfowler.com/architecture/9 - https://learn.microsoft.com/azure/architecture/patterns/10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/software-architecture-patterns13---1415# Software Architecture Patterns1617## Overview18Architecture patterns are reusable, named solutions to recurring structural problems — how to separate concerns, communicate between components, and contain failure. Each pattern solves one problem and introduces trade-offs, so choose by the problem you face, not the technology you want. Read this when structuring a new service or evaluating a refactor.1920## Official sources21- Martin Fowler's Software Architecture Guide: https://martinfowler.com/architecture/22- Azure Architecture Center — Cloud Design Patterns catalog: https://learn.microsoft.com/azure/architecture/patterns/2324## Core concepts25- **Layered (Presentation–Domain–Data)**: separate the UI, business logic, and data-access concerns so each can change independently; the dominant default for most applications.26- **Hexagonal / Ports & Adapters**: isolate the domain core behind explicit ports, with adapters for UI, persistence, and external systems, so infrastructure is swappable and the core is testable.27- **Event-driven architecture**: components communicate by emitting and reacting to events (often via Publisher-Subscriber), decoupling producers from consumers in time and identity.28- **Microservices**: develop a single application as a suite of small services, each in its own process, communicating over lightweight mechanisms — independently deployable but distributed.29- **Cloud design patterns**: technology-agnostic solutions (Circuit Breaker, Retry, Cache-Aside, CQRS, Saga, Bulkhead, Strangler Fig) that address reliability, scale, and integration in distributed systems.30- **Patterns are composable**: real workloads apply several together (e.g. Retry + Circuit Breaker; Queue-Based Load Leveling + Competing Consumers).3132## Best practices33- Choose a pattern from the problem and acceptable trade-offs, not from the technology — the Azure catalog explicitly advises starting from a constraint or risk in the workload.34- Default to a well-structured monolith with clear layering; adopt microservices only when team/scale boundaries justify the distributed-systems cost.35- Pair resilience patterns: combine Retry with Circuit Breaker so transient faults are retried but persistent faults stop hammering a failing dependency.36- Use the Strangler Fig pattern to migrate legacy systems incrementally instead of a risky big-bang rewrite.3738## Common pitfalls39- Adopting microservices for a small team or early product → you inherit network, consistency, and ops overhead without the scale benefit; keep a modular monolith until boundaries are clear.40- Believing distributed systems are reliable, low-latency, and infinitely scalable (the fallacies of distributed computing) → design compensations (timeouts, retries, idempotency) for each fallacy.41- Treating an antipattern as a pattern because it works at low load → re-evaluate designs that degrade as traffic grows.4243## Examples44```text45Resilient remote call (Azure pattern combo):46 client -> [Retry with backoff] -> [Circuit Breaker] -> remote service47 - Retry handles transient faults.48 - Circuit Breaker opens after repeated failures, failing fast and shedding load.49```5051## Further reading52- Azure pattern catalog with per-pattern problem/trade-off pages: https://learn.microsoft.com/azure/architecture/patterns/53- Fowler on microservices: https://martinfowler.com/articles/microservices.html5455## Related skills56- ../message-queues-async — event-driven and async messaging foundations57- ../scalability-reliability — resilience patterns under load58- ../api-design-rest-graphql — designing the interfaces between services