apollo
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
Top Related Projects
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
External configuration (server and client) for Spring Cloud
Library for configuration management API
Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
Distributed reliable key-value store for the most critical data of a distributed system
Quick Overview
Apollo is an open-source configuration management system designed for distributed environments. It provides a reliable way to manage configurations across different applications and services, offering features like real-time configuration changes, version control, and access control.
Pros
- Centralized configuration management for distributed systems
- Real-time configuration updates without service restarts
- Supports multiple environments and clusters
- Provides a user-friendly web interface for configuration management
Cons
- Requires additional infrastructure setup and maintenance
- Learning curve for teams new to centralized configuration management
- May introduce a single point of failure if not properly configured
- Limited built-in support for some programming languages
Code Examples
- Fetching a configuration value:
Config config = ConfigService.getAppConfig();
String someKey = config.getProperty("someKey", "defaultValue");
- Listening for configuration changes:
config.addChangeListener(new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent changeEvent) {
for (String key : changeEvent.changedKeys()) {
ConfigChange change = changeEvent.getChange(key);
System.out.println(String.format(
"Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s",
change.getPropertyName(), change.getOldValue(),
change.getNewValue(), change.getChangeType()));
}
}
});
- Creating a new namespace:
String appId = "your-app-id";
String namespaceName = "your-namespace";
String apolloMetaServerAddress = "http://config-service-url";
ApolloConfig apolloConfig = ApolloConfig.builder()
.appId(appId)
.namespace(namespaceName)
.apolloMetaServerAddress(apolloMetaServerAddress)
.build();
Config config = ConfigService.getConfig(apolloConfig);
Getting Started
- Add Apollo Client dependency to your project:
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>2.1.0</version>
</dependency>
- Configure Apollo Meta Server address in
app.properties
:
apollo.meta=http://your-meta-server:8080
- Initialize Apollo in your application:
Config config = ConfigService.getAppConfig();
- Use the configuration values in your code:
String someValue = config.getProperty("someKey", "defaultValue");
Competitor Comparisons
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
Pros of Apollo
- More comprehensive documentation and user guides
- Larger community and ecosystem with more contributions
- Better support for multi-language environments
Cons of Apollo
- Higher complexity and steeper learning curve
- Requires more resources to set up and maintain
- May be overkill for smaller projects or simpler use cases
Code Comparison
Apollo:
ConfigService.getAppConfig().getProperty("someKey", "defaultValue");
Apollo>:
Config config = ConfigService.getConfig("application");
String value = config.getProperty("someKey", "defaultValue");
Summary
Apollo is a more feature-rich and widely adopted configuration management system, offering extensive documentation and multi-language support. However, it comes with increased complexity and resource requirements. Apollo>, on the other hand, appears to be a simplified version or fork of the original Apollo project, potentially offering a more streamlined experience at the cost of some advanced features and community support.
Both projects use similar APIs for retrieving configuration values, with Apollo> requiring an additional step to specify the configuration namespace. The choice between the two would depend on the specific needs of the project, with Apollo being more suitable for larger, complex applications and Apollo> potentially better for simpler use cases or projects with limited resources.
External configuration (server and client) for Spring Cloud
Pros of Spring Cloud Config
- Seamless integration with Spring Boot applications
- Supports a wide range of backend storage options (Git, Vault, JDBC)
- Built-in support for encryption and decryption of sensitive properties
Cons of Spring Cloud Config
- Limited built-in UI for configuration management
- Lacks advanced features like grayscale release and configuration inheritance
- Requires additional setup for high availability and scalability
Code Comparison
Apollo:
Config config = ConfigService.getAppConfig();
String someKey = config.getProperty("someKey", "defaultValue");
Spring Cloud Config:
@Value("${someKey:defaultValue}")
private String someKey;
Additional Notes
Apollo offers a more comprehensive solution with features like a user-friendly UI, grayscale releases, and configuration inheritance. It also provides real-time configuration updates without requiring application restarts.
Spring Cloud Config, being part of the Spring ecosystem, integrates seamlessly with Spring Boot applications and leverages existing Spring concepts. It's more lightweight but may require additional components for advanced features.
Both solutions support various deployment models and can be used in microservices architectures. The choice between them often depends on specific project requirements and the existing technology stack.
Library for configuration management API
Pros of Archaius
- Mature project with extensive documentation and community support
- Seamless integration with other Netflix OSS components
- Built-in support for dynamic property updates
Cons of Archaius
- Less active development compared to Apollo
- Limited out-of-the-box support for distributed configurations
- Steeper learning curve for non-Java developers
Code Comparison
Apollo configuration example:
Config config = ConfigService.getAppConfig();
String someKey = "someKey";
String someDefaultValue = "someDefaultValue";
String value = config.getProperty(someKey, someDefaultValue);
Archaius configuration example:
DynamicStringProperty myProperty = DynamicPropertyFactory.getInstance()
.getStringProperty("my.property", "default");
String value = myProperty.get();
Both Apollo and Archaius are configuration management systems, but they have different approaches and features. Apollo offers a more modern, distributed configuration management solution with a user-friendly console, while Archaius provides robust integration with Netflix's ecosystem and dynamic property updates. Apollo may be more suitable for microservices architectures, while Archaius excels in Java-based Netflix OSS environments. The choice between the two depends on specific project requirements, existing infrastructure, and development team preferences.
Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
Pros of Consul
- More comprehensive service mesh capabilities, including service discovery and health checking
- Broader ecosystem with integrations for various cloud providers and tools
- Multi-datacenter support out of the box
Cons of Consul
- Steeper learning curve due to its extensive feature set
- Higher resource consumption, especially in large-scale deployments
- More complex setup and configuration process
Code Comparison
Apollo configuration example:
spring:
application:
name: your-app-name
apollo:
meta: http://config-service-url
bootstrap:
enabled: true
eagerLoad:
enabled: true
Consul configuration example:
service {
name = "your-service-name"
port = 8080
check {
http = "http://localhost:8080/health"
interval = "10s"
}
}
Both Apollo and Consul offer configuration management solutions, but they have different focuses. Apollo is primarily designed for centralized configuration management, while Consul provides a broader range of features including service discovery, health checking, and key-value storage.
Apollo excels in simplicity and ease of use, making it a good choice for projects that primarily need configuration management. Consul, on the other hand, offers a more comprehensive solution for microservices architectures, but comes with increased complexity and resource requirements.
When choosing between the two, consider your specific needs, the scale of your project, and the level of complexity you're willing to manage.
Distributed reliable key-value store for the most critical data of a distributed system
Pros of etcd
- Highly reliable distributed key-value store with strong consistency
- Supports automatic leader election and cluster management
- Widely adopted in large-scale distributed systems (e.g., Kubernetes)
Cons of etcd
- Limited to key-value data model, less flexible for complex configurations
- Requires more infrastructure setup and management
- Steeper learning curve for non-distributed systems developers
Code Comparison
etcd usage example:
cli, _ := clientv3.New(clientv3.Config{Endpoints: []string{"localhost:2379"}})
defer cli.Close()
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
_, err := cli.Put(ctx, "key", "value")
cancel()
Apollo usage example:
Config config = ConfigService.getAppConfig();
String someKey = config.getProperty("someKey", "defaultValue");
config.addChangeListener(new ConfigChangeListener() {
public void onChange(ConfigChangeEvent changeEvent) {
// Handle configuration changes
}
});
Key Differences
- etcd is a distributed key-value store, while Apollo is a more comprehensive configuration management system
- Apollo provides a user-friendly web interface for configuration management, whereas etcd typically requires command-line or programmatic interaction
- etcd focuses on distributed consensus and high availability, while Apollo emphasizes feature-rich configuration management and dynamic updates
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
English | ä¸æ
Apollo - A reliable configuration management system
Apollo is a reliable configuration management system. It can centrally manage the configurations of different applications and different clusters. It is suitable for microservice configuration management scenarios.
The server side is developed based on Spring Boot and Spring Cloud, which can simply run without the need to install additional application containers such as Tomcat.
The Java SDK does not rely on any framework and can run in all Java runtime environments. It also has good support for Spring/Spring Boot environments.
The .Net SDK does not rely on any framework and can run in all .Net runtime environments.
For more details of the product introduction, please refer Introduction to Apollo Configuration Center.
For local demo purpose, please refer Quick Start.
Demo Environment:
- http://81.68.181.139
- User/Password: apollo/admin
Screenshots
Features
-
Unified management of the configurations of different environments and different clusters
- Apollo provides a unified interface to centrally manage the configurations of different environments, different clusters, and different namespaces
- The same codebase could have different configurations when deployed in different clusters
- With the namespace concept, it is easy to support multiple applications to share the same configurations, while also allowing them to customize the configurations
- Multiple languages is provided in user interface(currently Chinese and English)
-
Configuration changes takes effect in real time (hot release)
- After the user modified the configuration and released it in Apollo, the sdk will receive the latest configurations in real time (1 second) and notify the application
-
Release version management
- Every configuration releases are versioned, which is friendly to support configuration rollback
-
Grayscale release
- Support grayscale configuration release, for example, after clicking release, it will only take effect for some application instances. After a period of observation, we could push the configurations to all application instances if there is no problem
-
Authorization management, release approval and operation audit
- Great authorization mechanism is designed for applications and configurations management, and the management of configurations is divided into two operations: editing and publishing, therefore greatly reducing human errors
- All operations have audit logs for easy tracking of problems
-
Client side configuration information monitoring
- It's very easy to see which instances are using the configurations and what versions they are using
-
Rich SDKs available
- Provides native sdks of Java and .Net to facilitate application integration
- Support Spring Placeholder, Annotation and Spring Boot ConfigurationProperties for easy application use (requires Spring 3.1.1+)
- Http APIs are provided, so non-Java and .Net applications can integrate conveniently
- Rich third party sdks are also available, e.g. Golang, Python, NodeJS, PHP, C, etc
-
Open platform API
- Apollo itself provides a unified configuration management interface, which supports features such as multi-environment, multi-data center configuration management, permissions, and process governance
- However, for the sake of versatility, Apollo will not put too many restrictions on the modification of the configuration, as long as it conforms to the basic format, it can be saved.
- In our research, we found that for some users, their configurations may have more complicated formats, such as xml, json, and the format needs to be verified
- There are also some users such as DAL, which not only have a specific format, but also need to verify the entered value before saving, such as checking whether the database, username and password match
- For this type of application, Apollo allows the application to modify and release configurations through open APIs, which has great authorization and permission control mechanism built in
-
Simple deployment
- As an infrastructure service, the configuration center has very high availability requirements, which forces Apollo to rely on external dependencies as little as possible
- Currently, the only external dependency is MySQL, so the deployment is very simple. Apollo can run as long as Java and MySQL are installed
- Apollo also provides a packaging script, which can generate all required installation packages with just one click, and supports customization of runtime parameters
Usage
- Apollo User Guide
- Apollo Open APIs
- Apollo Use Cases
- Apollo User Practices
- Apollo Security Best Practices
SDK
- Java SDK User Guide
- .Net SDK user Guide
- Golang SDK User Guide
- Python SDK User Guide
- NodeJS SDK User Guide
- PHP SDK User Guide
- C SDK User Guide
- Rust SDK User Guide
- HTTP API Guide
Design
- Apollo Design
- Apollo Core Concept - Namespace
- Apollo Architecture Analysis
- Apollo Source Code Explanation
Development
Deployment
Release Notes
FAQ
Presentation
Publication
Community
License
The project is licensed under the Apache 2 license.
Known Users
Sorted by registration orderï¼users are welcome to register in https://github.com/apolloconfig/apollo/issues/451 (reference purpose only for the community)
More... |
Awards
Stargazers over time
Top Related Projects
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
External configuration (server and client) for Spring Cloud
Library for configuration management API
Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
Distributed reliable key-value store for the most critical data of a distributed system
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot