I'm making a little forum for my clans website. I'm wondering if I should store the thread text in TEXT or BLOB? Whats the diffrence I've seen that phpBB does that.
What is BLOB anyway? cant find much about it on google.
Thanks
Cornelis
I'm making a little forum for my clans website. I'm wondering if I should store the thread text in TEXT or BLOB? Whats the diffrence I've seen that phpBB does that.
What is BLOB anyway? cant find much about it on google.
Thanks
Cornelis
BLOB is for binary data. I don't know the reason why phpBB 3 stores everything in binary but I have noticed it myself. My guess is that they are compressing/encoding whatever they put into the database. You could try looking through the phpBB source code to see if there is any comments explaining it.
A blob is just a bunch of bytes. An arbitrary number of bytes, nothing more.
If you were to store text as a blob, you'd have to worry about encoding (the process of translating text to bytes). But if you store things as text whatever database transport your using will make sure that the text stored in the database is properly encoded and decoded for both efficient storage and easy use.
If you're planning to store text, you should store text.
phpBB could implement text encoding and decoding themselves and that could be one reason to use blob instead of text. It's unlikely but sometimes text data types have a maximum length, the blob might be a work around for phpBB in this particular instance.
Re the "what" - BLOB is Binary Large OBject; compare to CLOB: Character Large OBject. Different databases call them different things, though - for example, on SQL Server you have image
/varbinary(max)
for BLOB, and text
/varchar(max)
for CLOB.
If a system only supports a BLOB, then one option is to encode strings - for example using UTF8. This might be what is happening.