'Don't want to store properties in database

I have some properties in my microservice. They are changed a lot so I want to store them somewhere out of microservice so that I don't have to undeploy it again and again. One solution is to store them in database but it will be less efficient that way. Can you advise me a solution where I can store them?

Basically this microservice is used by a vast number of people. I want that file to be read ONCE when microservice is deployed (unless or until there is some change in the file) to minimize the calls.



Solution 1:[1]

You should use Spring Cloud Config which enables to use a centralized server which exposes a Git Repo which you can use to store environment specific configuration files (application.properties)

Solution 2:[2]

You should go with Centralized configuration, spring cloud supports config server, It is highly recommended for microservice architecture. For reference: https://spring.io/guides/gs/centralized-configuration/

Basically, you have a centralized place to store all the configurations and don't need the redeploy the application every time you change the configs.

NOTE: in case you change the db properties then probably you need the restart the service

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 shazin
Solution 2 Aakash Thomas