Chapter 3. Controlling your configuration with Spring Cloud configuration server Flashcards
Cloud-based microservices development emphasizes:
- Completely separating the configuration of an application from the actual code being deployed
- Building the server and the application and an immutable image that never changes as it’s promoted through your environments
- Injecting any application configuration information at startup time of the server through either environment variables or through a centralized repository the application’s microservices read on startup
Describe application configuration management by establishing four principles
- Segregate— We want to completely separate the services configuration information from the actual physical deployment of a service. Application configuration shouldn’t be deployed with the service instance. Instead, configuration information should either be passed to the starting service as environment variables or read from a centralized repository when the service starts.
- Abstract— Abstract the access of the configuration data behind a service interface. Rather than writing code that directly accesses the service repository (that is, read the data out of a file or a database using JDBC), have the application use a REST-based JSON service to retrieve the configuration data.
- Centralize— Because a cloud-based application might literally have hundreds of services, it’s critical to minimize the number of different repositories used to hold configuration information. Centralize your application configuration into as few repositories as possible.
- Harden— Because your application configuration information is going to be completely segregated from your deployed service and centralized, it’s critical that whatever solution you utilize can be implemented to be highly available and redundant.
What the bootstrap.yml file does ?
The bootstrap.yml file reads the application properties before any other configuration information used. In general, the bootstrap.yml file contains the application name for the service, the application profile, and the URI to connect to a Spring Cloud Config server
What kind of information do you store in an application.yml file ?
Usually, the information you store in the application.yml file is configuration data that you might want to have available to a service even if the Spring Cloud Config service is unavailable.