TLDR, Haystack implements a sort of append-only journal design where smaller files are concatenated into a single large "journal" file. After adding, you get a "filename" back that is based on the information needed to locate the data you are interested in. volumename_seekposition.jpg, for example.
Essentially, you eliminate the need for FS metadata this way, which leads to less disk hits for read operations. Open volume, seek to position, read contents (including metadata) until end of file, you're done.
There is then a single-master database that controls the location of the volumes (with a redundant failover), which is possible because managing volumes is less difficult than managing the position of every single file in all the volumes in the system. I think they just use MySQL, amazingly.
Pretty neat idea. It's designed very specifically for photo storage at Facebook.
The main drawback with this design is that it doesn't support binding filesystem paths well - to do that you need a K/V database to match the name you want to the filename needed for Haystack/SeaweedFS. SeaweedFS can do this with a separate Redis and Cassandra "filer" database, but the Redis and Cassandra backends are currently implemented as "flat namespace" stores, so filers using them may not perform directory listings at this time. Huge drawback if you need to 'ls' subdirectories of files, for example.
That was a dealbreaker for me for neocities.org implementation, also maintenance was still an open question with SeaweedFS (when things fail, what do I do to fix them?) so I ended up going with CephFS.
There are postgres backed filer added already, which can list files.
Postgres of course does needs some special work to make it failover in production gracefully to a standby server. It would be nice to see something that's designed for it like redis work, but of course, that's a limitation of how redis is designed.
Regardless, I don't think I mentioned this properly, but SeaweedFS is amazing and it's very impressive, and using it at some point is not yet off the table for us. :)
I just haven't have time to test it and make it work yet. If you want to, you can help to verify this.
I could play with it a bit, but a full code analysis would be over my head.
Can I incentivize you in any way to review it? :)
"Instead of managing chunks, SeaweedFS manages data
volumes in the master server. Each data volume is size
32GB, and can hold a lot of files. And each storage node
can have many data volumes. So the master node only needs
to store the metadata about the volumes, which is fairly
small amount of data and is generally stable."If one master node goes down, the other master nodes will elect a new leader and control the system.
It's a KV data store. Which is fine...nothing wrong with that. It just isn't a filesystem in any sense I'm familiar with.
Edit: Ahh, I see. There's an optional piece that does provide at least directories. Still short of being a "filesystem" IMO, though: https://github.com/chrislusf/seaweedfs/wiki/Filer
Adding POSIX or not is more of a design choice. The blob storage layer can support both ways.
This isn't a filesystem anymore than etcd would be.