Cloud Computing,  Design Patterns,  Infrastructure,  Spring Framework

Spring Config Server & Client

Configuration are properties that are required by the application but that are specific to an environment. The 12 factor methodology for building cloud native applications notes that externalizing configuration is important where applications need to be deployed and run on multiple cloud environments where environment properties differ greatly.

Characteristics of software that has it’s configuration externalized is

  • Free of credentials
  • Free of internal information about the environment
  • Free of internal URLs

Applications that have their configuration externalized are portable and scalable. If the application is fed it’s configuration at startup then it is not coupled to a specific data center or instance making it easier to run deploy and run the same application in multiple data centers without the need to refactor the application itself, but by modifying the externalized configuration.

You can scale out new instances of the application using the same configuration from the externalized host without having to reconfigure another instance.

The spring Cloud framework specifically leverages a Config Server which centrally manages and versions configuration values and is backed by a GIT repository. This can extend across environments and you can implement patterns such as GitFlow to manage and stage configuration across multiple environments.

The Spring Cloud Config Server loads the configuration values at startup and then serves that configuration via REST endpoints to other applications and services that consume the config as a client. Config Server also supports branches and Spring profiles which provides flexibility in defining a different profile for each data center or a different instance of Config Server for each branch or all of the configuration in a single Config Server that is separated by branches making it easier to deploy to any number of Config Server instances in a particular data center.