Architectural Styles Overview
Architectural styles are reusable solution structures that address specific design challenges. They define high-level patterns for organizing software components and their relationships.
Component-Centric Styles
These styles focus on component organization and relationships.
Layered Architecture
Organizes components into horizontal layers where each layer only depends on the layer below it. Promotes separation of concerns and maintainability.
Clean Architecture
Organizes components in concentric circles with dependencies pointing inward toward the core domain. Business rules remain independent of external frameworks and databases. The major difference to the layered architecture is that the database sits "on top" (like the GUI), not "at the bottom".
Hexagonal Architecture
Isolates the application core from external concerns using ports (interfaces) and adapters (implementations). Enables easy testing and technology swapping.
Onion Architecture
Places the domain model at the center with all dependencies pointing inward. Similar to Clean Architecture but emphasizes domain-driven design principles.
Domain-Driven Architecture
Structures the system around domain boundaries using Bounded Contexts. Each context encapsulates its own domain model, language, and rules. Communication between contexts happens through well-defined interfaces, keeping domain concepts consistent within each boundary.
Volatility-Based Architecture
Decomposes the system along axes of expected change. Each component encapsulates a specific type of volatility, so that when change occurs, its impact is contained to a single component rather than rippling across the system.
Model-View-Controller (MVC)
Separates application logic into three interconnected components: Model (data), View (presentation), and Controller (user input handling).
Actor Model
Organizes computation as independent actors that communicate exclusively through asynchronous message passing. Each actor processes messages sequentially, eliminating shared state and race conditions.
Vertical Slices Architecture
Also known as Feature Folder Architecture. Organizes code by feature or use case rather than by technical layer. Each slice contains everything needed for a specific feature, from request to response.
Distribution-Oriented Styles
These styles focus on how components are distributed and communicate across networks.
Microservices Architecture
Structures applications as collections of loosely coupled, independently deployable services. Each service focuses on a specific business capability.
Event-Driven Architecture
Components communicate by producing and consuming events asynchronously. Promotes loose coupling and scalability through event-based communication.
Client-Server Architecture
Separates workloads between service providers (servers) and service requesters (clients). Forms the foundation for most networked applications.
Service-Oriented Architecture (SOA)
Organizes applications as reusable services that communicate through well-defined interfaces. Emphasizes service reuse and enterprise-wide integration.
Peer-to-Peer Architecture
Distributes tasks among equally privileged participants (peers) without central coordination. Each node acts as both client and server.
Pipe and Filter Architecture
Breaks processing into sequential steps (filters) connected by communication channels (pipes). Each filter processes data independently and incrementally.
Choosing the Right Style
Select architectural styles based on your system's specific requirements: scalability needs, maintainability focus, flexibility requirements, resource constraints, and team organization. Real-world systems often combine multiple styles.