I'm researching what is the best way to store application configuration data while supporting hierarchy and dynamic loading.
Data examples:
- Where to locate each column (we would display a lot of tables)
- How to visualize data in each column or cell (for example some column may have different ways to show the same metric)
- Data format (date or numbers)
Hierarchy means:
I have a state that has several districts, so there will be default configuration, but a state can override parts (or all) of the default configuration and a district can override parts of the state configuration.
Dynamic loading means:
Ability to dynamically load and apply new configuration without needing a server restart or even user login.
Configuration storing format (can be files or DB):
- XML – that's what I was using in the past
- JSON - so I can read JSON from a config file or database and have it as an object in the app memory
- Key-Value pairs
- other formats?
What are your thoughts/knowledge about this subject?
Thank you!
Propertiesclass that's made for reading in and writing out sets of key/value pairs. Far as i've seen, it's the standard for dealing with arbitrary sets of configuration values. It even lets you construct chains/trees of Properties objects, so you can have defaults in the parent that a child overrides.