SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add design
Chris Lu050ab1926409
diff --git a/weed/filer/vasto_store/design.txt b/weed/filer/vasto_store/design.txtnew file mode 100644index 0000000000..99faa29d61--- /dev/null+++ b/weed/filer/vasto_store/design.txt@@ -0,0 +1,45 @@+There are two main components of a filer: directories and files.++My previous approach was to use some sequance number to generate directoryId.+However, this is not scalable. The id generation itself is a bottleneck.+It needs careful locking and deduplication checking to get a directoryId.++In a second design, each directory is deterministically mapped to UUID version 3,+which uses MD5 to map a tuple of <uuid, name> to a version 3 UUID.+However, this UUID3 approach is logically the same as storing the full path.++Storing the full path is the simplest design.++separator is a special byte, 0x00.++When writing a file:+ <file parent full path, separator, file name> => fildId, file properties+For folders:+ The filer breaks the directory path into folders.+ for each folder:+ if it is not in cache:+ check whether the folder is created in the KVS, if not:+ set <folder parent full path, separator, folder name> => directory properties+ if no permission for the folder:+ break+++The filer caches the most recently used folder permissions with a TTL.+ So any folder permission change needs to wait TTL interval to take effect.++++When listing the directory:+ prefix scan of using (the folder full path + separator) as the prefix++The downside:+ 1. Rename a folder will need to recursively process all sub folders and files.+ 2. Move a folder will need to recursively process all sub folders and files.+So these operations are not allowed if the folder is not empty.++Allowing:+ 1. Rename a file+ 2. Move a file to a different folder+ 3. Delete an empty folder++