Markus Malkusch's weblog 

PHP hates BLOBs for a long time.

by Markus Malkusch


Posted on Sunday May 10, 2015 at 02:41PM in Technology


There seems to be this uninformed dogma about databases and files. People tend to constantly repeat the mantra "Store files in the file system". While the disadvantages are obvious (no ACID), the disciples bring as the only advantage performance concerns

There's this excellent research regarding performance "To BLOB or Not To BLOB", which comes to the conclusion:

Objects smaller than 256K are best stored in a database while objects larger than 1M are best stored in the filesystem.

But please don't stop reading here. This statement is valid only for SQL Server 2005. Therefore I wanted to make some benchmarks for some current DBS. I've chosen to use PHP for those benchmarks, as I am afraid that Java is indeed too fast with memory mapped files. Suprisingly I came to the conclusion, for PHP the mantra is indeed correct. This conclusion came quickly even before I could implement the benchmark. Since 8 years PHP has an unresolved bug which doesn't allow streaming Blobs from the database. This makes any further research needless.



No one has commented yet.

Leave a Comment

HTML Syntax: Ausgeschaltet