开发者

Memory table, memcached info or simple PHP array

I have a CMS with "type of document" being a table of just about 20 rows with id, and type (varchar). Very simple, but it's used in almost all pages of the CMS in several queries.

1) Wo开发者_运维百科uld it be better to convert this to MEMORY table ? If yes, how can i ensure each time the MySQL is restarted I will have that table ?

2) Would it be better to use memcached to store that info ?

3) Maybe the simplest and also the best performance is just to have this in an array in the typical conf.php loaded in all pages

Thank you


As far as performance goes it's pretty unlikely that table is ever going to a performance bottleneck, I'd be more concerned with what makes development easier and what meets the apps requirements. If you don't have any requirement that they be dynamic/user editable then I'd go for creating this in PHP since that will make updating it during development easier to manage, particularly when writing tests as this will allow you to avoid loading the document types into the test db every time.

If it does need to be user editable then just store it in the DB and don't worry about doing anything funky with MEMORY table types, unless your use case is particularly odd that's likely to do more harm than good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜