i've often found that i'd like to store some small details for my module in the database somewhere, but it's stuff that's not worth creating a whole new table for. i think the only place that this data can go now is in the variable table, and in my opinion there are many entries in that table that really don't need to be loaded into $conf all the time--it seems like a waste of resources.
irc discussion with a few other devs has gotten my thoughts to this point on the topic:
another place to put these kinds of 'occasionally used' variables would have the following benefits
- less bloat in the $conf array, meaning less memory usage
- more definition between vars that need to be loaded w/ every page request, and those that only need to be accessed occasionally
- a nice spot for module devs to put small pieces of useful information (ex. a timestamp that records the last time operation X was done)
downsides:
- more code
- more in the db
- more decisions for a module developer
the downsides seem almost none to me--i just threw them in for balance... :)
i can see this being implemented in one of two ways:
- a new table, 'storage', which has the same basic structure as variable--only difference being that the stuff in there isn't loaded all the time. also two helper functions that mimic what variable_get and variable_set do
- a new column in the variable table, which marks the entry as to whether it is to be loaded all the time or not. also extending the functionality of variable_get and variable_set so operations can be performed on either kind
drumm also suggested that it would be cool if drupal itself could decide which vars get marked in which fashion, based on some criteria. i like the idea in theory, but it seems that doing so would create more bloat than we're eliminating. if anyone sees a way to make this idea work, i'd love to hear more about it!
thoughts? opinions??