Common Software Architecture Patterns and Their Applications
This article introduces ten common software architecture patterns—layered, client‑server, master‑slave, pipe‑filter, proxy, P2P, event‑bus, MVC, blackboard, and interpreter—explaining their structures, typical use cases, and advantages to help developers choose suitable designs for large‑scale systems.
Do you want to know how large‑scale enterprise systems are designed? Before software development begins, we must choose an appropriate architecture that provides the required functionality and quality attributes. Therefore, before applying an architecture to our design, we should understand the characteristics of various architectural patterns.
What is an architectural pattern?
According to Wikipedia, an architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. It is similar to a software design pattern but applies at a larger scope.
This article briefly explains ten common architectural patterns, their usage, and their pros and cons.
1. Layered Pattern
This pattern is suitable for constructing programs that can be decomposed into groups of sub‑tasks, each residing at a specific level of abstraction. Each layer provides services to the layer above it.
Typical four‑layer architecture in information systems:
Presentation layer (also called UI layer)
Application layer (also called service layer)
Business logic layer (also called domain layer)
Data access layer (also called persistence layer)
Use Cases
General desktop applications
E‑commerce applications
2. Client‑Server Pattern
The pattern consists of a server and multiple clients. The server component provides services to many client components. Clients request services from the server, and the server continuously listens for client requests.
Use Cases
Online applications such as email, document sharing, and banking apps.
3. Master‑Slave Pattern
The pattern consists of a master component and one or more slave components. The master distributes work to the slaves and aggregates the results returned by the slaves.
Use Cases
Database replication where the master handles writes and slaves synchronize.
Peripheral devices on a system bus (master driver and slave drivers).
4. Pipe‑Filter Pattern
This pattern is used to create stream‑processing systems. Each processing step is encapsulated in a filter component, and data flows through a pipeline of filters. Pipelines can also serve buffering or synchronization purposes.
Use Cases
Compilers – lexical analysis, parsing, semantic analysis, and code generation are performed by successive filters.
Information‑processing workflows
5. Proxy Pattern
The pattern decouples components in a distributed system. Proxy components coordinate communication between services. Servers publish their capabilities to the proxy; clients request services from the proxy, which forwards the request to the appropriate service via a registry.
Use Cases
Message‑broker software such as Apache ActiveMQ, Apache Kafka, RabbitMQ, JBoss Messaging.
6. P2P Pattern
In this pattern, each component is a peer that can act both as a client and a server. Peers may change roles dynamically, requesting services from other peers while also providing services.
Use Cases
File‑sharing networks such as Gnutella and G2.
Cryptocurrency‑related products like Bitcoin and blockchain platforms
7. Event‑Bus Pattern
This pattern focuses on event handling and consists of four main components: event source, event listener, channel, and event bus. The source publishes messages to a specific channel on the bus; listeners subscribe to channels and are notified when messages arrive.
Use Cases
Android development.
Notification services
8. MVC Pattern (Model‑View‑Controller)
The pattern separates an interactive application into three parts: the model (core functionality and data), the view (presentation to the user, possibly multiple), and the controller (handles user input). This decoupling enables efficient code reuse and independent evolution of components.
Use Cases
Web development architectures used by most programming languages.
Web frameworks such as Django and Rails
9. Blackboard Pattern
The pattern is useful for problems without a deterministic solution strategy. It consists of three main parts: a global blackboard (structured shared memory holding solution objects), knowledge sources (specialized modules with their own representations), and a control component (selects, configures, and executes modules).
Use Cases
Speech recognition.
Vehicle identification and tracking.
Protein structure identification.
Sonar signal analysis
10. Interpreter Pattern
This pattern designs a component that interprets programs written in a specialized language. It defines how each sentence or expression of the language is evaluated, typically by creating a class for each symbol in the language.
Use Cases
Database query languages such as SQL.
Languages used to describe communication protocols
Feel free to discuss and share your viewpoints. If you have questions, you can contact the author for communication.
At the end, a collection of interview questions from major tech companies (BAT) is offered; reply with the keyword to receive the questions.
Join the "Top Architect" community by scanning the QR code and providing your name, company, and position.
Copyright statement: Content originates from the internet; all rights belong to the original author. If any infringement is found, please notify us for immediate removal.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
