E
E
Emin Gadimli2018-11-15 14:50:04
Database design
Emin Gadimli, 2018-11-15 14:50:04

What is the best way to store images in a database?

The question is. Decided to write a small bulletin board. There was a problem saving images in the database. Started saving paths to images. What is the best way to save images to minimize disk consumption? I write in Php, Laravel

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artemy, 2018-11-15
@MetaAbstract

Store in the file system so that the database does not swell.

A
ARX2, 2018-11-22
@ARX2

I already did this to write to the database, I had to encode the pictures through base_64, then decode, then stream to the page. More crap and extra load on the base, it was lucky that the base was rubber.
If you have pictures of 3 meters, then your page will take longer to load, and besides, this page will be immediately thrown out of the search. It's better to do as you were told, get the optimization of the images and save them in the FS, but it's better to cut one more picture for each resolution. So that one picture is for example: 300x200, 150x150... (Depending on what sizes of images you have on the page)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question