A
A
AlikDex2016-07-12 04:58:47
Data storage
AlikDex, 2016-07-12 04:58:47

Structure of storage of originals and miniatures of images on the server?

Actually the question is this. Let's say we will generate a path using md5 from a file, or just from an image ID, it doesn't matter. The question is a little different. How to store thumbnails for pictures?
1) use a prefix. You get something like:

/a5/e4/c7/18d7b47aedf325e9143bfce8cc.s.jpg
(or _s.jpg) The downside is that for the thumbnail each time you will need to parse the file name and add a prefix. Or start a special column for the cabinet in the database.
2) use the final category where the file is located:
/a5/e4/c7/thumb/18d7b47aedf325e9143bfce8cc.jpg

But here you still need to do some manipulations with the path to the file (concatenation, for example, if you store the path and file name separately)
3) Use an external folder for thumbs:
/thumbs/a5/e4/c7/18d7b47aedf325e9143bfce8cc.jpg

I'm torn between 2 and 3. What more high-performance from your point of view for a disk subsystem?
They have already hit the ceiling, so the option with slicing on the fly and caching in the form of files is not considered due to an unnecessary call to check for the existence of a file, and the RAM of the required volume turns out to be a little expensive.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2016-07-12
@Rsa97

IMHO, for a disk subsystem the first variant is the most productive. It can be slightly modified, storing the file name without extension in the database, adding a suffix and extension when inserted into the page. In the database, then it is enough to keep a sign of the presence of a thumbnail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question