SeaweedFS
What is SeaweedFS
SeaweedFS is a fast, highly scalable distributed storage system designed to handle billions of files with extremely low latency. It is famously inspired by Facebook’s Haystack whitepaper https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Beaver.pdf , which was created to solve the “small file problem”. The performance bottleneck that occurs when a file system has to perform multiple disk seeks just to find a single tiny photo or document.
SeaweedFS is an open-source distributed storage system designed to store and serve billions of files efficiently, especially lots of small files LOSF. seafeedfs has O(1) disk seek complexity. The main idea here is that instead of storing a single file with unique id and having to go to disk everytime to figure out it’s location, the in-memory metadata keeps both the volume server and the file key. For example volumeId,fileKey,cookie = 3,01637037d6,8a1b2c . The master tells clients which volume server contains volumeId=3, and the client fetches the file directly.
Core components (k8 context)
- Filer: enforces POSIX-compliance
- Volume Server: actual data storage housing volumes (combination of files/objects)
- s3 api : endpoint for s3 clients (stateless; connects via filer). Enforces s3 compatibility
- master : Keeps metadata needed for locating files/objects.
Installing Seaweed on kubernetes (non operator mode)
helm repo add seaweedfs https://seaweedfs.github.io/seaweedfs/helm
helm repo update
helm install seaweedfs seaweedfs/seaweedfs \
--namespace seaweedfs \
--create-namespace
kubectl get all -n seaweedfs # for verificationsome values you might want to update
master.replicas(typically 3 for HA)volume.replicasandvolume.dataDirs(storage size + storageClass)filer.replicasandfiler.s3.enabled: trueif you want an S3 endpointfiler.data(persistent volume for filer metadata)s3.enabledfor a standalone S3 gateway
installation in operator mode
Get Ngomba Litombe’s stories in your inbox
Join Medium for free to get updates from this writer.
If you want lcm
git clone https://github.com/seaweedfs/seaweedfs-operator.git
cd seaweedfs-operator
make deploy IMG=chrislusf/seaweedfs-operator:latestThe seaweed CR looks like so
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: seaweed1
namespace: default
spec:
image: chrislusf/seaweedfs:latest
volumeServerDiskCount: 1
master:
replicas: 3
volumeSizeLimitMB: 1024
volume:
replicas: 1
requests:
storage: 10Gi
filer:
replicas: 2Brief Comparisons to minIO
MinIO follows AWS S3 closely and is ideal for testing for S3 API. It has good UI, policies, versionings, etc. SeaweedFS is trying to catch up here. It is also possible to put MinIO as a gateway in front of SeaweedFS later.
MinIO metadata are in simple files. Each file write will incur extra writes to corresponding meta file.
MinIO does not have optimization for lots of small files. The files are simply stored as is to local disks. Plus the extra meta file and shards for erasure coding, it only amplifies the LOSF problem.
MinIO has multiple disk IO to read one file. SeaweedFS has O(1) disk reads, even for erasure coded files.
MinIO has full-time erasure coding. SeaweedFS uses replication on hot data for faster speed and optionally applies erasure coding on warm data.
MinIO does not have POSIX-like API support.
MinIO has specific requirements on storage layout. It is not flexible to adjust capacity. In SeaweedFS, just start one volume server pointing to the master. That’s all.
Seaweed enterprise Cost
https://seaweedfs.com/docs/deploy/
Free Under 25TB
$2/TB Per Month
$20/TB Per Year








