Skip to content

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

Open
nickasd opened this issue Apr 12, 2017 · 2 comments
Open

Implementing a filesystem #145

nickasd opened this issue Apr 12, 2017 · 2 comments

Comments

@nickasd
Copy link

nickasd commented Apr 12, 2017

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.

@wmertens
Copy link

wmertens commented Apr 17, 2017 via email

@nickasd
Copy link
Author

nickasd commented Apr 24, 2017

This sounds to me the same as the "flat" implementation that I described earlier, or do you mean something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants