I have a LAMP server with 256MB RAM (poor man’s server in cloud). I have an app written to run on this machine. Currently people upload images and they go straight into mysql as BLOB.
There are concerns that this might be very memory consuming operation and we move over it to simple plain files. Can some one tell me if these concerns are valid? (Worth putting efforts into changing a lot of ode that’s already written given that we will have sufficient RAM in next 6 months ?)
As a general rule when should we store images in DB and when as files?
To read a
BLOBinMySQLyou need three times as much memory as it takes (it gets copied into several buffers).So yes, reading a
BLOBinMySQLconsumes more memory than reading a file.