Scalable Architecture for Large Websites: Modular Design, Distributed Messaging, Service Platforms, and Open APIs
The article explains how to build a highly scalable large‑website architecture by adopting modularization, reducing coupling through distributed message queues and services, and exposing functionality via an open platform, covering core concepts, typical implementations like ActiveMQ and Dubbo, and essential design considerations.
This article is part of a series on large‑website technical architecture, covering the evolution, patterns, core elements, high‑performance, high‑availability, and scalability aspects.
Scalability is defined as the ability of a system to extend or improve its functionality with minimal impact on existing components.
The core idea of designing a scalable website architecture is modularization , which reduces inter‑module coupling and enables module reuse. Modules are deployed independently on separate servers (clusters), physically separating them.
After distributed deployment, modules are integrated mainly through distributed message queues and distributed services .
1. Using Distributed Message Queues to Reduce System Coupling
If modules do not call each other directly, adding or modifying a module has minimal impact on others, improving scalability.
An event‑driven framework passes event messages between loosely coupled modules, typically using the producer‑consumer pattern. In large‑website architectures, the most common implementation is a distributed message queue, as shown below:
The queue works on a publish‑subscribe model: producers publish messages, and one or more consumers subscribe to them.
Because producers do not wait for consumers to process data, response latency improves, and during traffic spikes messages can be temporarily stored, relieving pressure on databases and other back‑ends.
Many open‑source and commercial distributed message queue products exist; a well‑known example is Apache ActiveMQ. Its architecture is illustrated below:
2. Using Distributed Services to Build a Reusable Business Platform
Distributed services further reduce coupling by exposing interfaces that different subsystems can invoke, rather than sharing raw messages.
Key requirements and characteristics of distributed services for large websites include:
Load balancing
Failover transfer
Efficient remote communication
Integration of heterogeneous systems
Minimal intrusion to applications
Version management
Real‑time monitoring
One widely adopted open‑source framework in China is Alibaba's Dubbo . Its architecture is shown below:
Service consumers use service interfaces; the framework loads the concrete implementation, which may be local or remote, keeping application intrusion low. Clients obtain provider lists from a service registry, apply load‑balancing strategies, and automatically switch to alternative providers on failure, ensuring high availability.
3. Building an Open Platform to Create an Ecosystem
Large websites often expose internal services as APIs to third‑party developers, forming an open platform.
The open platform acts as a bridge between internal services and external developers, typically following a common architectural pattern (illustrated below):
API interfaces : exposed to developers, can be RESTful, WebService, RPC, etc.
Protocol conversion : translates external API calls into internal service formats and vice versa.
Security : authentication, permission control, and tiered bandwidth limits to ensure fair resource usage.
Auditing : records third‑party access for monitoring and billing.
Routing : maps external requests to specific internal services.
Workflow : composes discrete services into higher‑level business processes, hiding implementation details behind unified interfaces.
Source: http://blog.csdn.net/chaofanwei/article/details/28386363
© Content sourced from the internet; copyright belongs to the original author. We will remove any infringing material upon notice.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
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.