开发者

Is bad to read/write from a database serialized data at every page load?

开发者 https://www.devze.com 2023-02-05 21:44 出处:网络
I\'m thinking of storing serialized data (usually 1-3kb in a TEXT column) in a database, however I\'m concerned whether or not it\'ll be resource expensive.

I'm thinking of storing serialized data (usually 1-3kb in a TEXT column) in a database, however I'm concerned whether or not it'll be resource expensive. At every page load, the data is read, and by the end of the page load, the data is written back into the same field, if it has been开发者_运维技巧 altered (thinking of having some type of checksum to do this).

Would it just be better to avoid doing this? Or should I use files instead?


1) Using database is better than using files.

2) If the serialized data can be mapped to a database table, it's better. If not, you're doing it right.

Remember, the TEXT, BLOB, etc columns are not stored inline with the rest of the fields of the table. For BLOB and TEXT data, the information is stored internally in a different area of memory than the row buffer.

0

精彩评论

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