Large file storage specification in mongdb --- GridFS

    mongdb has an upper limit on the size of a single BSON, and the maximum size does not exceed 16MB, but in reality, the size of many files exceeds this threshold, what should I do? Remember how data packets are transmitted in computer networks? By the way, grouping! Same here. Mongdb also uses a similar decomposition idea, dividing a large file into many small files no more than 16MB. How to divide? After the division is completed, how do you need to restore the files and how to reorganize them? This requires a set of specifications called GridFS. The specific implementation level is reflected in fs.files and fs.chunks. fs.chunks is the divided small pieces of data, the specific details are not mentioned. Read books by yourself. The fs.files file records information about all grouped blocks, such as their numbers and their sizes.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325846399&siteId=291194637