Search code examples
javaspring-bootspring-securityspring-boot-configuration

How to handle configuration When Spring Boot config server itself is down?


I'm new to the spring cloud config server. Consider a scenario where we have 10 spring boot microservice fetching configurations from the Spring Boot Cloud Config. I was wondering How the 10 spring boot microservices will work when the Spring Boot Cloud Config itself is down?

Can someone answer to below queries:

  1. If the config server is down, Will there be downtime for all the microservice connected to it?
  2. Let's say we have a config file application.properties in GitHub and Spring boot config refers to the application.properties file in GitHub What if the username and password to access the application.properties file itself will change?
  3. In terms of Disaster recovery, Do we need any backup of the config server? If yes, How can we achieve the same?

Solution

  • If the config server is down, Will there be downtime for all the microservice connected to it?

    In real world application, there will be multiple instances of your config server deployed across multiple availability zones, fronted by load balancer or API gateway, or even you can register your multiple instance with eureka server so that there is
    No single point of failure.
    So how the configuration will look like is instance 1 is in us-east-1
    instance 2 in us-west-2, so even if one AZ is down it will not impact your services.

    As far as GitHub or external repo is concerned, you can configure config server to read properties natively but that not something I will suggest !!

    Let's say we have a config file application.properties in GitHub and Spring boot config refers to the application.properties file in GitHub What if the username and password to access the application.properties file itself will change?

    First of all you should not commit password in Github for public repo, secondly password should be dynamically fetched from Idvault, or AWS secret Manager or other services whichever you prefer. So that even if you change password it will not affect any services.

    In terms of Disaster recovery, Do we need any backup of the config server? If yes, How can we achieve the same?

    Config server is just reading properties/config from repo that you provide,so repository where your code is hosted is of importance to you. Github can take care of that for you !!