M
M
MR.TOSTER Gipard Valerievich2016-06-19 20:12:06
PHP
MR.TOSTER Gipard Valerievich, 2016-06-19 20:12:06

What if you store small binary files in mongodb without using gridFS?

PHP, as I understand it, is in a transitional period and the new mogodb driver is still pimply and raw.
And to be more precise, there is no way to work with GridFS.
You need to save a little, and files in the size of 100kb - 1mb It is necessary to
read and give to users a lot.
What can be tricky if I store the file in a line?
Will Nginx Gridfs serve files from regular rows the same way it does with GridFS?
Plus, GridFS is recommended for files larger than 16mb, and I have a maximum of 1mb.
How then is it recommended to store files up to 16mb, in lines?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2016-06-20
@zoceb

What can be tricky if I store the file in a line?
Store binary, not string.
Will Nginx Gridfs serve files from regular rows the same way it does with GridFS?
Unlikely
Plus, GridFS is recommended for files larger than 16mb, and I have a maximum of 1mb.
No, this is a document size limit, GridFS is fine for any size.
You can store this amount binary in one document, the downside is that if the file is 15MB, then it may take a lot of memory to receive and transfer it, in the case of GridFS, the file is cut into pieces (200kb or so).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question