Strategy in storing ad-hoc numbers/constants?

Posted by Jiho Han on Stack Overflow See other posts from Stack Overflow or by Jiho Han
Published on 2010-02-19T16:16:55Z Indexed on 2010/05/09 13:08 UTC
Read the original article Hit count: 245

Filed under:
|

I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind.

These numbers are then used in a calculation that involve other more structured figures.

I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app.

One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution.

Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

© Stack Overflow or respective owner

Related posts about database

Related posts about design