Mastering Spring Cloud
上QQ阅读APP看书,第一时间看更新

Git backend

The Git version control system has some features that make it very useful as a repository for property sources. It allows you to easily manage and audit changes. By using well-known VCS mechanisms such as commit, revert, and branching, we can perform important operations a lot easier than in a filesystem approach. This type of backend also has another two key advantages. It forces a separation between the Config Server source code and the property files repository. If you take a look one more time at the previous examples, you will see that the property files were stored together with the application source code. Probably some of you would say that even if we used a filesystem backend, we can store the whole configuration as a separate project on Git and upload it to a remote server on demand. Of course, you would be right. But when using a Git backend with the Spring Cloud Config, you have those mechanisms available out of the box. In addition, it resolves the problems related to running multiple instances of the server. If you use a remote Git server, the changes may be easily shared across all of the running instances.