Why Wikipedia Uses BLOB Type Instead of TEXT Type in MySQL

database-designmariadbMySQL

As I experienced, Blob type is good choice when you want to save binary data such as images or videos etc and Text type is good choice when you want to save large string.

Today I saw Wikipedia database. The interesting thing was that wiki use medium blob type for storing wikitext of the page.

enter image description here

So I want to know why Wiki prefer to use Blob type instead of Text?

Thanks

Best Answer

The 'right' way to store text is to use TEXT with CHARACTER SET ut8fmb4. However, that requires the you know what encoding exists in the client, so that it can be converted (by MySQL) as it is stored.

By storing into BLOB, the above issue is eliminated. However, that leads to another issue -- how to display the text.

Another possible excuse for BLOB is that Wikipedia was probably started before utf8mb4 was added to MySQL.

(We can only guess.)