-
Notifications
You must be signed in to change notification settings - Fork 453
Implementing a filesystem #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You could also make folders into separate documents, so you can move around
subtrees by changing the parents.
…On Wed, Apr 12, 2017, 1:38 PM Nickasd ***@***.***> wrote:
Based on inputs from #143 <#143>,
I was curious about what could be the best way to implement a hierarchical
filesystem with folders and documents. I started with a "flat"
implementation where each file/folder is a document with a required field
"path" which is its absolute path. The client would then get all the files
and build a file tree.
The problem with this approach is when it comes to renaming: renaming a
folder means renaming all the contained files/subfolders. One way to
overcome this problem would be to have just one root document representing
the filesystem and each file/folder is stored in a json array. The question
here is: could this be a problem? In the case of a big number of files, the
document would end up being huge.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#145>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADWlg4HTFewzy7D5kUKfVV3ySRbYPFyks5rvLedgaJpZM4M7Th4>
.
|
This sounds to me the same as the "flat" implementation that I described earlier, or do you mean something else? |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on inputs from #143, I was curious about what could be the best way to implement a hierarchical filesystem with folders and documents. I started with a "flat" implementation where each file/folder is a document with a required field "path" which is its absolute path. The client would then get all the files and build a file tree.
The problem with this approach is when it comes to renaming: renaming a folder means renaming all the contained files/subfolders. One way to overcome this problem would be to have just one root document representing the filesystem and each file/folder is stored in a json array inside this document. Each folder would then have a "contents" array where all the contents are stored, recursively. The question here is: could this be a problem? In the case of a big number of files, the document would end up being huge.
The text was updated successfully, but these errors were encountered: