Skip to content
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

Unlimited number of files directories #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions text/0075-unlimited-number-of-files-directories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- FIP: (Number, to be assigned)
- title: Create unlimited number of files and directories in a parent directory
- author: (Sabyasachi Patra, @asabya)
- status: draft
- created: (2023-11-17)

# Summary
This proposal is to create unlimited number of files and directories inside a directory.

# Context, motivation and guide level explanation
We store files list in a single chunk. This limits the number of files and directories as a single chunk size is 4096 bytes.

This proposal solves that by storing file list as a file. This will allow us to create unlimited number of files and directories.

We already have a working file uploading mechanism for both fairOS-dfs and fdp-storage. We can use that to upload the list in a new topic `index.dfs`.
So for every directory we store a `/DIR_PATH/index.dfs` file. This file will contain `Metadata` of the list of files and directories of that directory.

# Reference-level explanation

- we create a new file `index.dfs`.
- We upload the list at this `/DIR_PATH/index.dfs` path, but do not add that entry in the parent directory list.
- we set the min block size to `1000000` and `gzip` as compression type

Pseudo code:

```
d.fileObject.Upload(listData, "index.dfs", int64(len(listData)), 1000000, "/DIR_PATH", "gzip", podPassword)
```

### Why such approach?
In fairOS-dfs we can update file content given an offset. This allows us to update the pod list file without having to upload the entire file again.

We do not break anything. We read the previous list and update with this proposed solution at runtime with whatever logic is required.
## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).