The term BLOB can be found primarily in con­nec­tion with databases and open source projects. It is used for storing binary data (i.e. data which can contain non-printable char­ac­ters as well as arbitrary bit patterns). Typical examples of such data types include images, audio files, com­pressed files and spread­sheet data. If you plan to use Binary Large Objects in a project, certain pro­ced­ures must be followed. So, what exactly is a BLOB? What char­ac­ter­ises it? What are the ad­vant­ages and dis­ad­vant­ages of using it?

What is a BLOB (Binary Large Object)?

BLOB stands for Binary Large Object. BLOBs are different from CLOBs (Character Large Objects) and TEXTs in that while CLOBs and TEXTs also deal with large data types, these consist of character strings.

As pre­vi­ously mentioned, large binary data types include images, audio files, archive files and spread­sheet data. In addition, videos are also clas­si­fied as BLOBs which is why binary files can easily be several hundred gigabytes. According to Jim Starkey, the inventor of the BLOB, the name BLOB came before the acronym was actually defined as Binary Large Object. In 1997, Starkey clarified that BLOB was defined as an acronym because it was too un­pro­fes­sion­al for marketing purposes otherwise.

BLOBs in databases

BLOBs in databases need to be processed in a special way. Special data types are un­avoid­able. Databases cannot read or un­der­stand the un­struc­tured data in BLOBs. They can only store it all. Databases can only read the file name, type and size of the BLOB. Therefore, it is im­possible to use database functions such as sorting, filtering and searching for specific content in a BLOB.

Note

The dif­fer­ence between struc­tured and un­struc­tured data is that the former has a clear structure. All in­form­a­tion in struc­tured data can be displayed in cor­res­pond­ing database fields. Un­struc­tured data, on the other hand, will not allow you to see the content. Only the data type is known.

Binary Large Objects are stored by different database systems in different ways. Since the structure of databases is often not suitable for storing BLOBs directly, they are stored ex­tern­ally. The database itself thus only contains a reference to where the external file is actually stored. There are also al­tern­at­ive terms for de­scrib­ing large binary files depending on the database system being used. Some solutions, such as MySQL, even use different terms for files of specific sizes. You can view some of the most popular systems along with their re­spect­ive terms for Binary Large Objects in the following table.

Database Data type
MySQL Up to 0.255 KB: TINYBLOBUp to 64 KB: BLOBUp to 16 MB: ME­DI­UMBLOBUp to 4 GB LONGBLOB
Post­gr­eSQL BYTEA and Object Iden­ti­fi­er
Oracle BLOB
DB2 BLOB
Microsoft SQL Server binary, varbinary, text, ntext

Where are BLOBs used?

BLOBs are primarily used in the big data industry. Raw data is collected en masse from website visitors, bundled together into col­lec­tions of data and stored worldwide in databases. In its raw form, this collected data is un­struc­tured so that is the easiest way for database systems to collect it. BLOBs can also be used to store films or tele­vi­sion shows in databases in a quasi-encrypted form.

Binary Large Objects are also used in the open source arena. Even though, by defin­i­tion, all parts of an open source project are supposed to be able to be generated from a publicly ac­cess­ible source code, this is not always the case. In some cases, pro­pri­et­ary elements (mainly device drivers) are also included which are only available in binary form. The term “BLOBs” is also used for this data, but the inclusion of these objects in open source projects is quite con­tro­ver­sial.

Ad­vant­ages and dis­ad­vant­ages of Binary Large Objects

The question of whether to use BLOBs for a project needs be con­sidered on a case-by-case basis as they both have important ad­vant­ages and dis­ad­vant­ages.

Ad­vant­ages Dis­ad­vant­ages
BLOBs are a good option for adding large binary data files to a database and can be easily ref­er­enced Not all databases permit the use of BLOBs
It is easy to set access rights using rights man­age­ment BLOBs are in­ef­fi­cient due to the amount of disk space required and access time
Database backups or dumps contain all the data Creating backups is highly time consuming due to the file size of BLOBs
Go to Main Menu