[wp-hackers] Best practices for plugin with complicated settings?

Andrew Nacin wp at andrewnacin.com
Sun Jul 25 21:28:01 UTC 2010


On Sun, Jul 25, 2010 at 6:39 AM, Ashish Saini
<ashishsainiashfame at gmail.com>wrote:

> Also I would like to know if there is any size limitation of how much data
> can be saved in a single row in the options table?
> Instead of saving multiple rows, isn't it better to store it as a single
> value in a row.


The hypothetical size limitation according to MySQL is something like 2^32
bytes. If you are holding many kilobytes of data in an autoloaded row,
especially if it might scale O(N), then you may wish to rethink your storage
strategy. (Post type?)

Regarding performance, consider that it can be something which is used in
> the front-side or needed only in back-end (irrespective of site's
> functioning, just an specific need to operate some data independently
> integrated with WP install).


Again, this is more or less a hypothetical, so it's really tough to blindly
address your concerns. Even more so if this isn't a plugin you plan to
distribute and rather you know the server and caching system it is running
against. A rule of thumb might be to not autoload options that can get
really large, if you'll never need them on the front end, but again I'm not
thinking about that in the context of a caching system. If what you do need
on the front end is small, and you're also storing some pretty significant
data in your DB option, you may wish to split into two options.


More information about the wp-hackers mailing list