XF 2.2 text vs blob?


Well-known member
What is the reason that XF uses blobs instead of text?
Because i dont want to add millions of fields i put all data for my next add-on in one text_field xf_forum.xc_data;
it looks like:


When I need my values i can do it in templates with


I can see what is happen in phpMyAdmin
I dont need to to any translation encoding, decoding, whatever.

But there must be a reason why xf uses blob instead of text?
Last edited:
If the field is text, all the data must be valid UTF8. Depending on MySQL server configuration this might be 3-byte or 4-byte UTF8.

If it is a blob type, MySQL will not care about the contents.

Basically, if you are encoding arbitrary json use a blob field. If you are encoding very limited json which will never have unicode text, emojis or user provided text, then it can be safe to use text.

Finally, you really should be aware of the length limits. text or blob is limited to 64k bytes, while longtext or longblob is vastly larger.
Thank you very much.
The field is used to save vars from admin forms, mostly integers and a path for default icon.
i use

to save every new table_field i can save, when no search/filter/index is needed.
Top Bottom