Working Principles
The architecture of Apollo is designed as depicted in the following diagram:
Responsibilities of each module in the diagram are outlined below:
Module | Responsibilities |
---|---|
Config Service | Provides functions such as reading and pushing configurations, serving Apollo clients |
Admin Service | Provides functions such as modifying and releasing configurations, serving Apollo Portal (management interface) |
Eureka | Provides service registration and discovery. For simplicity, Eureka is currently deployed in the same JVM process as Config Service. Both Config Service and Admin Service are deployed in a stateless manner with multiple instances. Therefore, they need to register themselves with Eureka and maintain a heartbeat. |
Meta Server | A layer built upon Eureka, encapsulating Eureka’s service discovery interface. |
- Clients access Meta Server via domain name to obtain a list of Config Service instances (IP+Port), and then directly access the service via IP+Port. Load balancing and error retry are performed on the client side.
- The Portal accesses Meta Server via domain name to obtain a list of Admin Service instances (IP+Port), and then directly accesses the service via IP+Port. Load balancing and error retry are performed on the Portal side.
- To simplify deployment, Config Service, Eureka, and Meta Server are actually deployed in the same JVM process.
Execution Flow
- Upon startup, Config/Admin Service automatically registers with the Eureka service registry and periodically sends keep-alive heartbeats.
- Apollo Client and Portal management end access a Meta Server via the configured domain name, which is then load balanced by a Software Load Balancer before being assigned to a specific Meta Server.
- Meta Server retrieves service information for Config Service and Admin Service from Eureka, acting as an Eureka Client.
- Meta Server retries if it fails to obtain service information for Config Service and Admin Service (IP+Port).
- Once the correct service information for Config Service and Admin Service is obtained, Apollo Client provides configuration acquisition and real-time update functions for the application via Config Service. The Apollo Portal management end provides configuration addition, modification, and release functions via Admin Service.
Core Concepts
Concept | Understanding | Keywords |
---|---|---|
application | The application in which the Apollo client runs. | appId |
environment | The environment in which the Apollo client runs. | env |
cluster | A grouping of different instances under an application, such as grouping by data center. | cluster |
namespace | A grouping of different configurations under an application. | namespaces |
For a detailed understanding of namespaces, refer to the official documentation - What is a Namespace?.