storj-archived / core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
https://storj.io
Other
396 stars 88 forks source link

Switch to use user filesystem (or alternative) instead of KFS, better accounting of usage #723

Closed braydonf closed 5 years ago

braydonf commented 7 years ago

Use filesystem (or alternative) for storing shards in a directory named by hash. Continue to use leveldb for contracts, however there can be indexes added so that it's possible to search by:

Pros:

Cons:

See discussion at https://github.com/Storj/dev-meetings/blob/master/2017-08-30-summary.md#shard-storage-in-storjshare

ne0ark commented 6 years ago

Yes please get rid of leveldb. Its already causing headaches: https://github.com/Storj/storjshare-daemon/issues/247 . Using regular file system can allow sharing of extra mounted cloud storage in future better.

stefanbenten commented 6 years ago

@ne0ark If you mount cloud storage for publishing cloud storage something is completely wrong. At least in my opinion. If its possible to get cloud space from anywhere cheaper, the question should be why is StorJ more expensive! Or am i getting something wrong here?

felixbrucker commented 6 years ago

The con FAT32 filesystem would have maximum number of files is no real con, FAT32 is a filesystem which is very old and should never be used.

aleitner commented 6 years ago

Currently working on benchmarking alternative methods for storing data.

Requirements

littleskunk commented 6 years ago
ne0ark commented 6 years ago

Auto heal without waiting gazillion hours to repair. Since it will drop reputation.

JAC2703 commented 6 years ago

I agree that the fs should be used for the actual data, with a small dB used to handle the metadata. It seems there were scaling issues with using a single database for all the data (which is how things started) so the resolution was to use 256 databases instead, effectively multiplying that same problem by 256. This also implemented certain limits, such as a maximum shard size (1/ 256 of total space) and also an upper limit of 8tb for one node (each dB is limited in size so that you don't notice any problems such as locks when it's compacting). It's removed any possibility of future proofing, especially given the rate that HD capacity has increased in recent years.

All of this just seems crazy on every technical level. Clearly the dB is being used beyond its intended purpose.

Storj have done some truly brilliant things, but I don't feel the storage mechanism is one of them.

braydonf commented 6 years ago

It may be worth storing smaller data, less than 2MB or so, in the contracts database, or a similar database. And for larger shards store them with a filesystem using following scheme:

↳ <2-bytes> directory - first two bytes of shard hash used as the directory name
  ↳ <2-bytes> directory - next two bytes of the shard has used as the directory name
    ↳ <16-bytes> file - the last remaining bytes used for the filename

This should work well across many different filesystems, though we should do benchmarking to verify.

felixbrucker commented 6 years ago

I would very much hope these two do not get mixed. Actually i dont see the problem for small files given the dir structure. If not avoidable please use a separate db for that. Many, including me, would like to keep contracts and actual data separate.

aleitner commented 6 years ago

Experiment 1 https://github.com/aleitner/libmapstore Experiment 2 https://github.com/aleitner/libfilestore Also experimenting with storing directly in sqlite

RichardLitt commented 5 years ago

👋 Hey! Thanks for this contribution. Apologies for the delay in responding!

We've decided to rearchitect Storj, so that we can scale better. You can read more about this decision here. This means that we are entirely focused on v3 at the moment, in the storj/storj repository. Our white paper for v3 is coming very, very soon - follow along on the blog and in our Rocketchat.

As this repository is part of the v2 network, we're no longer maintaining this repository. I am going to close this for now. If you have any questions, I encourage you to jump on Rocketchat and ask them there. Thanks!