Software Architecture Patterns

Prof. Dr. Mirco Schoenfeld

Architectural Patterns

An architectural pattern is a general, reusable resolution to a commonly occurring problem in software architecture within a given context.

https://en.wikipedia.org/wiki/Architectural_pattern

Scope

Architectural patterns are similar to software design pattern but have a broader scope.

https://en.wikipedia.org/wiki/Architectural_pattern

https://refactoring.guru/design-patterns

Debatable

Separation of architectural and design patterns is not commonly agreed.

Also, patterns are not catalogued in any accepted form.

Purpose

My aim:

Introduce you to a small selection to illustrate possibilities.

Client-Server Pattern

(Mallawaarachchi 2017)

Client-Server Pattern

Pros

  • very common pattern (WWW, eMail, file sharing, …)
  • central adminstration/storage/computing of data
  • business logic remains central

Cons

  • holding all data centrally introduces bottlenecks
  • central server needs to be powerful (= expensive)

Peer-to-peer Pattern

(Mallawaarachchi 2017)

Peer-to-peer Pattern

Pros

  • decentralization
  • widely used pattern (file-sharing, streaming protocols, Bitcoin and Blockchain)
  • robust against node failures
  • highly scalable in terms of resources and computing power

Cons

  • no guarantee about quality of services
  • security is difficult to be guaranteed (you have to trust peers)
  • performance depends on the size of the network

Controller-Responder Pattern

(Mallawaarachchi 2017)

Controller-Responder Pattern

Pros

  • very similar to the client/server pattern
  • adding more responders increases capabilitis of the software
  • controller executes services on responders

Cons

  • controller is the central bottleneck. should not fail.
  • responders are isolated - no shared state
  • pattern not universally applicable (only for decomposable problems)

Broker or Publish-/Subscribe Pattern

(Mallawaarachchi 2017)

Broker or Publish-/Subscribe Pattern

Pros

  • communication is asynchronous
  • easy to add or remove publishers and subscribers
  • great scalability & flexibility

Cons

  • testing can be challenging because of asynchronous communication
  • high reliability in message emission needed (sensitive to network failures)
  • requires policies for message formatting and exchange

Microservices Pattern

(Gupta and Sahu 2023)

Microservices Pattern

Pros

  • great scalability
  • independent services with little interdependencies
  • very common in cloud-based systems

Cons

  • complexity in managing distributed architecture
  • data consistency is a challenge
  • communication overhead between services

Layered Pattern

(Butani 2020)

Layered Pattern

Pros

  • very common pattern
  • each layer is a different level of abstraction
  • each layer provides services to the next higher layer
  • provide good logical organization

Cons

  • layers introduce complexity
  • not universally applicable
  • risk of architecture sinkhole anti-pattern - actions are passed through layers without adding logic

Model-View-Controller Pattern

(Mallawaarachchi 2017)

Model-View-Controller Pattern

Pros

  • great for interactive applications
  • separates internal representations of information from presentation
  • decoupling of components
  • allows for efficient code reuse

Cons

  • increases complexity
  • unnecessary updates for user actions might occur

Common Scenario

Combination of multiple architectural patterns to address specific application requirements.

Overviews

Gupta and Sahu (2023)

Further Reading

Many good resources out there:

Walker (2022), Reselman (2021), Taylor, Medvidovic, and Dashofy (2008), …

References

Butani, Anand. 2020. “5 Essential Patterns of Software Architecture.” https://www.redhat.com/architect/5-essential-patterns-software-architecture#client-server.
Gupta, Ritvik, and Ankit Sahu. 2023. “Software Architecture Patterns: What Are the Types and Which Is the Best One for Your Project.” https://www.turing.com/blog/software-architecture-patterns-types/.
Mallawaarachchi, Vijini. 2017. “10 Common Software Architectural Patterns in a Nutshell.” 2017. https://towardsdatascience.com/10-common-software-architectural-patterns-in-a-nutshell-a0b47a1e9013.
Reselman, Bob. 2021. “The Pros and Cons of the Pub-Sub Architecture Pattern.” https://www.redhat.com/architect/pub-sub-pros-and-cons.
Taylor, Richard N, Nenad Medvidovic, and Eric Dashofy. 2008. Software Architecture. Chichester, England: John Wiley & Sons.
Walker, Vicki. 2022. “14 Software Architecture Design Patterns to Know.” https://www.redhat.com/architect/14-software-architecture-patterns.