Skip to content
IRC-CodingIRC-Coding
Architecture PatternsC4 ModelADRHexagonal ArchitectureLayered ArchitectureCQRS

Architecture Patterns Explained: Goals & Trade-offs

Master architecture patterns, quality attributes, design decisions, C4/ADR documentation, and communication strategies.

S

schutzgeist

2 min read
Architecture Patterns Explained: Goals & Trade-offs

Architectural Patterns

This article is a glossary entry on architectural patterns — including exam questions, examples, and key takeaways.

In a Nutshell

Architectural patterns are reusable solution structures at the system level. They describe context, forces, solution, and consequences—focusing on quality attributes like maintainability, scalability, security, and testability.

Technical Definition

An architectural pattern defines the overall system structure (for example, layering, ports & adapters, microservices, event flows) and shapes quality attributes.

Key trade-offs include:

  • Consistency versus availability
  • Synchronous RPC chains versus asynchronous messaging
  • Centralized database versus data per service

Modern systems often combine multiple patterns (for instance, DDD boundaries plus hexagonal architecture per service). Exam topics cover pattern definitions, consequences, use cases, and risks like the distributed monolith anti-pattern.

Exam-Relevant Topics

  • Differences and consequences of monolith versus microservices
  • Layered architecture and dependency inversion
  • Ports & adapters (hexagonal)
  • IHK: Naming quality goals and metrics (MTTR, latency)
  • Security: Zero Trust, secrets management, service-to-service authentication
  • Economics: operational and license costs, team boundaries
  • Documentation: C4 (levels 1–3) and ADRs

Core Components

  1. Context and assumptions
  2. Problem and forces
  3. Structure and building blocks
  4. Communication style (sync/async)
  5. Data strategy
  6. Interfaces and protocols
  7. Build, test, deployment, and observability
  8. Architectural elements (layers, adapters)
  9. Security (authentication/authorization, isolation)
  10. Testing (contract and chaos tests)

Practical Example (Hexagonal, Simplified)

Domain: Order.confirm() produces a domain event
Application service orchestrates the use case
Ports define contracts (repository, message bus)
Adapters couple REST, SQL, and Kafka

Strengths and Weaknesses

Strengths

  • Better changeability
  • Improved testability
  • Targeted quality attributes

Weaknesses

  • Increased complexity
  • Infrastructure and observability requirements
  • Risk of distributed monolith patterns

Typical Exam Questions (With Brief Answers)

  1. When is layered architecture suitable? When responsibilities are clear and dependencies flow inward.
  2. Microservices versus monolith: what’s the core difference? Deployment independence, data ownership, and transaction boundaries.
  3. What does hexagonal architecture achieve? It isolates core business logic from input and output concerns through ports and adapters.

Free-Form Response

Learn patterns through problem, forces, solution, and consequences. Document architectural decisions as ADRs and visualize with C4.

Learning Strategy

  1. Sketch a C4 diagram for a system.
  2. Mark synchronous and asynchronous paths for each use case.
  3. Practice short definitions and trade-offs.
  4. Name risks and mitigation measures.

Further Reading

  1. https://microservices.io/patterns
  2. https://c4model.com/
  3. https://martinfowler.com/architecture
Back to Blog
Share:

Related Posts