Database design for traditions and ini-file-like data with integrity
I would like some viewpoints to best handle situations where you have normal (traditional) database data, and at the same time also have data that looks more like "ini file" data and you want to maintain consistency between them (heirachical data?).
For example, suppose I have a table "CURRENCY" with 100 rows. At the same time, I have a system parameter for "default currency" and this needs to be mapped to one of these 100 lines.
At the moment, I would store the default currency code in an XML config file, ini file, or in the Windows registry. This is fine for the data, but its a bit of a job to make sure the values in the XML file actually match the valid foreign key values in the database.
How can this be done (declaratively?) In the database so that heirachical data can be referenced and therefore have integrity with relational data?
a source to share
This cannot be done as the configuration parameter can always be updated by an external program such as a text editor, regedit, etc. The only way to prevent this is to start a service that constantly monitors the file or registry settings and disallows any changes if the database has not been started and an integrity check can also be performed. This is obviously redundant - the correct solution is to store the configuration data in the database.