Store image in MySQL database [closed]

0

I find the situation that, I have to show through a query to a MySQL database in the cloud an image in an android tlf, through a PHP file.

The doubt is that I do not know which is the best or easiest way to do it, if saving the image as a blob or keeping it in the cloud and in the database refer to it with a varchar. I imagine that if I keep it as a blob, I will have to serialize it and then deserialize it, so I imagine that the second option is easier, I would appreciate any comment.

    
asked by Las Perseidas 02.02.2018 в 12:17
source

1 answer

1

I think it's a matter of decisions about performance and database size that you should evaluate.

I usually use a Varchar. Why?

  • I've done some tests and I have not seen performance improvements in hosting it on the base.

  • The base is heavier using blob or longblob.

  • I usually do processes with the images once inside the server to shrink them, etc.

  • I hope I have been helpful.

        
    answered by 02.02.2018 / 12:29
    source