Software Architecture Patterns: Traditional Three‑Tier, Cluster, Distributed, and Microservice Architectures
This article explains common software architecture patterns—including traditional three‑tier, cluster (horizontal scaling), distributed (vertical splitting), and microservice (vertical division) architectures—detailing their components, advantages, drawbacks, and configuration examples such as Tomcat clustering with Nginx load balancing.
The article introduces several typical software architecture patterns used in web applications, ranging from the classic three‑tier model to modern microservice designs.
1. Traditional three‑tier architecture divides an application into presentation, business, and persistence layers. The presentation layer handles request reception and forwarding, the business layer processes the request (including transaction management and logging), and the persistence layer manages database interactions. Examples of MVC implementations include Struts (model‑view‑controller) and Spring MVC, where the DispatcherServlet acts as the controller, services form the model, and JSP pages serve as the view.
2. Cluster architecture (horizontal scaling) addresses resource imbalance in a single‑server setup by deploying multiple identical instances of the same project across several servers. A reverse‑proxy server such as Nginx performs load balancing, distributing incoming requests to the Tomcat instances. Session sharing is achieved through Tomcat’s clustering configuration, ensuring user data (e.g., shopping‑cart contents) persists even if one node fails. An example of the required <Cluster>...</Cluster> configuration for Tomcat is provided.
3. Distributed architecture (vertical splitting) breaks a system into separate modules (sub‑systems) that are deployed on different servers. Each module can itself be clustered, achieving high availability while allowing independent development and deployment. The article notes that while distributed architectures improve fault tolerance, they also increase management complexity.
4. Microservice architecture (vertical division) further refines the distributed approach by defining services around business capabilities. Services communicate via HTTP or RPC, and each can be clustered for resilience. Sub‑sections cover:
4.1 SOA architecture – highlights the complexity of many inter‑service calls and suggests using Dubbo for efficient RPC communication.
4.2 Dubbo – presents a typical Dubbo‑based architecture diagram and explains how Dubbo manages service registration, discovery, and remote invocation.
4.3 Spring Cloud – describes Spring Cloud as a suite built on Spring Boot for service governance, detailing the flow of a request through API Gateway (Zuul), Eureka registry, Ribbon load balancer, Feign client, Hystrix circuit breaker, and Turbine monitoring.
The article also compares Dubbo and Spring Cloud, noting differences in supported registries, communication protocols, and performance characteristics.
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.
