| Category | Patterns |
|---|
| Structural( Focuses on Inner parts of the system) | MVC, Layered Architecture, Client-Server Architecture, Pipe-and-Filter Architecture, Hexagonal Architecture, Microkernel Architecture |
| Behavioral | Event-Driven Architecture, CQRS, Event Sourcing |
| Landscape(Focuses on big picture of the systems) | Microservices Architecture, Service-Oriented Architecture, Serverless Architecture, Domain-Driven Design |
1. Structural Patterns
Structural patterns define the organization and static components of a system. They focus on modularity and maintainability.
- Layered Architecture: Segments the application into layers like Presentation, Business, and Data layers.
- Client-Server Architecture: Divides components into clients and servers.
- Pipe-and-Filter Architecture: Organizes the system into independent processing stages connected by pipes.
- Hexagonal (Ports and Adapters) Architecture: Separates core logic from external systems to improve testability and integration.
- Microkernel Architecture: Centers on a minimal core system with extensible plug-ins.
2. Behavioral Patterns
Behavioral patterns focus on the dynamic flow of control, interactions, and data throughout the system.
- Event-Driven Architecture (EDA):
- Mediator-based EDA: Events flow through a central mediator.
- Broker-based EDA: Events are handled by independent producers and consumers via a broker.
- CQRS (Command Query Responsibility Segregation): Separates read and write models for distinct handling.
- Event Sourcing: Captures all state changes as events for traceability.
3. Landscape Patterns
Landscape patterns deal with the overall deployment, scalability, and modularity of applications in distributed or enterprise-level systems.
- Microservices Architecture: Creates independently deployable and scalable services.
- Service-Oriented Architecture (SOA): Provides loosely coupled services interacting through standardized protocols.
- Serverless Architecture: Focuses on managing functions without worrying about infrastructure.
- Domain-Driven Design (DDD): Aligns application design with domain models for complex business logic.
1. Layered (n-tier) Architecture
Description: Organizes software into layers, each responsible for specific functionality.
- Common Layers:
- Presentation Layer: Handles the user interface.
- Business Layer: Implements business logic.
- Data Access Layer: Manages database operations.
- Database Layer: Stores data persistently.
Use Cases: Enterprise applications, e.g., CRM systems.
2. Event-Driven Architecture (EDA)
Description: Components communicate by producing and consuming events.
- Components:
- Event Producers: Generate events.
- Event Consumers: React to events.
Types:
- Mediator-based: Central mediator manages events.
- Broker-based: Producers and consumers communicate via a broker.
Use Cases: Real-time systems, IoT applications.
3. Microservices Architecture
Description: Application is built as a collection of small, autonomous services.
- Characteristics:
- Each service has its own database.
- Services communicate via lightweight protocols like REST or messaging.
Use Cases: Large, scalable systems with high modularity requirements.
4. Client-Server Architecture
Description: Divides system into clients that request services and servers that provide them.
- Example: A web browser (client) and web server.
Use Cases: Web applications, email systems.
5. Event Sourcing
Description: Records all state changes as a sequence of events.
- Advantages:
- Complete audit trail.
- Easy state reconstruction.
Use Cases: Financial applications, systems requiring historical tracking.
6. Microkernel Architecture
Description: Core system handles minimal operations, while plug-ins extend functionality.
- Components:
- Core: Manages basic operations.
- Plugins: Add specific features.
Use Cases: IDEs like Visual Studio, extensible software.
7. Pipe-and-Filter Architecture
Description: Data flows through a series of processing steps (filters) connected by pipes.
- Advantages:
- High modularity.
- Easy to modify and extend.
Use Cases: Compilers, data processing pipelines.
8. Service-Oriented Architecture (SOA)
Description: Application functionalities are delivered as loosely coupled services.
- Communication: Uses protocols like SOAP or REST.
Use Cases: Distributed systems, enterprise integration.
9. Serverless Architecture
Description: Application functions are deployed and run in cloud-managed environments without worrying about infrastructure.
- Benefits:
- Cost-efficient for variable workloads.
Use Cases: Short-lived or event-driven tasks.
10. Hexagonal (Ports and Adapters) Architecture
Description: Focuses on separating the core logic from external systems.
- Components:
- Ports: Define interactions.
- Adapters: Handle external interface implementation.
Use Cases: Systems needing easy testability and integration.
11. CQRS (Command Query Responsibility Segregation)
Description: Separates read and write operations into different models.
- Advantages:
- Scalability.
- Specialized models for reads and writes.
Use Cases: Applications with high read/write disparity.
12. Domain-Driven Design (DDD)
Description: Aligns system design closely with domain concepts.
- Focus Areas:
- Entities.
- Value Objects.
- Aggregates.
Use Cases: Complex systems with significant business logic.