julian_lp wrote:Yes, in this scenario I think it'd work quite well, but what if the settings could be modified by the users?
Thats a key issue. Also, you didn't mention what you are hoping to accomplish - what are your requirements. Security? Memory use? Parsing speed?
By way of example, PanamaJack brings up the performance difference between config files and database loading. I've had very different experiences, with extremely similar data, primarily because we have vastly different requirements. I prefer to minimize the number of files that are writable by the server, to reduce security issues.
I don't put a heavy emphasis on memory use. Speed, however, is a concern of mine.
With those requirements, storing and retrieving ~200 config options from a database can be relatively quick. By using caching correctly (by which I mean caching individual records, not mysql's 'flush entire tables of cache data if one row changes'), you can keep the speed relatively quick. Without any caching, for the ~200 config options in my game, I was able to consistently load it with only a penalty of about two hundreths of a second per page. (The game generally renders a page in approximately 0.20-0.45 seconds). Thats hardly "horrendously slow". With proper caching, there is no measurable increase in time, except when the settings change (and then it is the previously mentioned timing).
Server load is a non-trivial concern. With proper caching, its extremely low, and without, its a reasonable increase. Its far below a 1% (of the games load - not server) increase on my server, making it within the margin of error between runs.
Put another way, you are seriously considering the performance impact of a *single* select pulling 20 rows. If THAT is horrendously slow, pretty much no dynamic site on the planet is fast enough for those absolute standards.
Making design choices based on absolutes is the epitome of the quote "Premature optimization is the root of all evil".
Set out your requirements, try different things, test, and see which meets your requirements.
My personal take, is that if the settings aren't likely to change often, and security isn't a primary concern, but memory use is, go with files. Otherwise, don't sweat a single select with 20 rows. Thats just silly.