threefoldtech / 0-hub

Threefold Images Hub
https://hub.grid.tf
Apache License 2.0
1 stars 1 forks source link

Migrate backend from single ardb to grid of 0-stor. #2

Closed rkhamis closed 3 years ago

rkhamis commented 6 years ago

Issue migrated from [https://api.github.com/repos/zero-os/0-hub/issues/29](), opened by @zaibon

The backend architecture of the backend of the 0-hub need to be improve. We need to migrate from a single ardb instance to a multiple instance of 0-stors.

rkhamis commented 6 years ago

*commented by @despiegk remark: redundancy is in client?

lets create architecture doc*

rkhamis commented 6 years ago

*commented by @maxux

Summary of the changes needed

First of all, we will discard any backward compatibility with the new code. We can keep the old infrastructure up (as long as it can survive), but new flist and backend will not serve the old as-it.

New flist creation

The hub needs to be able to upload files on the new 0-stor backend, which requires a python client.

The current flist implementation only stores a list of chunks with their encryption key. The new 0-stor backend will different kind of information:

To save the metadata needed by the 0-stor, we need to change the chunk list to map the chunk metadata structure: https://github.com/zero-os/0-stor/blob/master/client/README.md#metadata

Using flist on 0-fs

The 0-fs program should support both old and new version of the flist. The configuration url already uses protocol prefix on the URI, we can easily support new things and keep the old support. If the flist contains all the metadata, it can directly request files without asking metadata from etcd.

Roadmap overview

rkhamis commented 6 years ago

commented by @GlenDC In order to support (and thus implement this feature), issue https://github.com/zero-os/0-stor/issues/352 will have to be resolved. But for that some collective brainstorming and discussion will be required, as there is currently not yet a proposed solution for that issue. As long as that issue isn't resolved you won't be able to store data that is available (in read-only mode) for public.

rkhamis commented 6 years ago

*commented by @GlenDC

remark: redundancy is in client?

The 0-stor client provides erasure coding or replication as storage strategies to provide redundancy to data. When data gets corrupted (but is still readable) it can also be repaired back into an optimal state.*

maxux commented 3 years ago

Since we are using 0-db as backend, there is nothing to do regarding the hub itself. It's database side to choose what to do.

We should move to https://github.com/threefoldtech/0-stor_v2 and 0-db offload feature.