F
F
Fuckingawesomenigga2022-01-28 21:22:43
MongoDB
Fuckingawesomenigga, 2022-01-28 21:22:43

How to store images? DB or disk storage?

There are similar questions, but here, as I understand it, the conditions are important.
Let's say at the peak, the project may have 5000 images, although this figure is already unlikely.
The size of each is 200KB, let's say a maximum of 500KB.
The most convenient (just already implemented) option is to encode in BASE64 and shove it into the database (mongodb), does it make sense to remake it for storage on disk?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2022-01-28
@rPman

The most convenient (just already implemented) option is to encode in BASE64 and shove it into the database
kick harder than the one who told you this nonsense
to store such a meager volume is more convenient and best of all - in files
and a large volume - also in files
modern file systems - the best key-value database (and some kind of cow like xfs or btrfs still and will offer transactions based on snapshots out of the box), and store the file name in sql databases (you can generate it from an identifier or a hash as convenient) and perform your complex queries and filtering.
well, a bonus - the web server works best with files when it comes to static, when you get all the bonuses of multithreading every time you get it from the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question