Common Software Architecture Patterns and Their Characteristics
This article introduces seven common software architecture patterns—layered, multilayer, pipe‑filter, client‑server, MVC, event‑driven, and microservices—explaining their context, typical problems they address, core solutions, inherent drawbacks, and suitable application scenarios for developers and system designers.
Software architecture patterns provide reusable solutions to recurring design problems in a given context. This article covers seven widely used patterns, describing their context, the problems they solve, the proposed solution, weaknesses, and typical usage scenarios.
Layered Architecture – The classic n‑tier model (presentation, business, persistence, database) separates concerns into distinct layers, improving modularity and maintainability. Each layer exposes a single‑directional interface to the layer below. Weaknesses include performance overhead due to multiple hops and higher initial complexity; it is best suited for small to medium‑size applications with limited performance constraints.
Multilayer Architecture – Extends the layered concept by grouping related components into logical layers, often illustrated with a J2EE consumer‑website example. It addresses the need for clear separation in distributed systems, but inherits similar drawbacks such as added cost and complexity.
Pipe‑Filter Architecture – Decomposes processing into a series of filters connected by pipes, ideal for stream‑oriented transformations (e.g., ETL, compilers). Typical components are source, map, reduce, and sink. Weaknesses include limited suitability for interactive systems and potential performance loss due to excessive parsing.
Client‑Server Architecture – Clients issue requests to servers, which process and respond. This model centralizes shared resources, improving scalability and reuse, but can create a performance bottleneck and a single point of failure, making changes costly.
Model‑View‑Controller (MVC) – Separates an application into Model (data), View (presentation), and Controller (mediator). It facilitates independent evolution of UI and business logic, especially for web or mobile front‑ends. Drawbacks include unnecessary complexity for simple UIs and possible mismatch with certain UI toolkits.
Event‑Driven Architecture – Handles asynchronous events via independent processors and queues, scaling from small to large systems. It solves the problem of decoupled, asynchronous processing but may suffer from performance and error‑recovery challenges. Example flow: an OrderCreated event triggers credit checks, leading to CreditReserved or CreditLimitExceeded events.
Microservices Architecture – Breaks a monolithic application into independently deployable services, each with its own API boundary and data store. This improves scalability, allows heterogeneous technology stacks, and supports continuous delivery. Weaknesses include increased operational overhead, need for robust monitoring, and higher costs.
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.
Code Ape Tech Column
Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn
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.
