What is the best way to manage configuration data

前端 未结 8 1199
时光取名叫无心
时光取名叫无心 2020-12-07 17:18

I am working on a product suite which has 4 products. Right now, all of the configuration data is either in the XML or properties files.This approach is not maintainable as

8条回答
  •  一生所求
    2020-12-07 18:00

    There are plenty of different strategies. All of them are good and depends on what suit you best.

    1. Build a single artifact and deploy configs to a separate location. The artifact could have placeholder variables and, on deployment, the config could be read in. Have a look at Springs property placeholder. It works fantastically for webapps that use Spring and doesn't involve getting ops involved.
    2. Have an externalised property config that lives outside of the webapp. Keep the location constant and always read from the property config. Update the config at any stage and a restart will be up the new values.
    3. If you are modifying the environment (i.e. application server being used or user/group permissions) look at using the above methods with puppet or chef. Also have a look at managing your config files with these tools.

提交回复
热议问题