File system implementation in MongoDB with GridFS

Posted by Ralph on Programmers See other posts from Programmers or by Ralph
Published on 2012-10-31T12:56:53Z Indexed on 2012/10/31 17:13 UTC
Read the original article Hit count: 317

Filed under:
|

I am working on two projects that will both implement a Webdav server backed by a MongoDB GridFS. In each case, there is the potential for the system to store tens of millions of files spread across thousands of hierarchical directories.

I can come up with two different ways of storing the directory structure:

  • As a "true" hierarchical file system, with directories containing the IDs (_id) of subdirectories and regular files. The paths will be separated by slashes (/) as in a POSIX-compliant file system.

    • The path /a/b/c will be represented as a directory a containing a directory b containing a file c.
  • As a flat file system, where file names include the slashes.

    • The path /a/b/c will be stored as a single file with the name /a/b/c

What are the advantages and disadvantages of each, with respect to a "real" folder-based file system?

© Programmers or respective owner

Related posts about file-systems

Related posts about mongo