Hello. Before I enter the self hosting space and dump my data into Nextcloud, I need to look at an affordable trustworthy backup strategy. How do I go about integrating blockchain storage into the nextcloud external storage offering? Is that possible? I know of only 2 so far, Storj on Ethereum and Iagon on Cardano, but their number is growing. The api guide is available online, for iagon for example https://api.docs.iagon.com.
I’m not a web dev myself, but if it’s something I could handle with guidance, I might give it a swing - if the storage layer is supported at all.
Anyone got a high level picture of what’s involved, time estimates for a skilled dev, maybe someone will to get cracking?
Cheers, M
Hello and welcome to the forum @mindfuse!
first, I want to give you a hint generally. You wrote that you want to do something with backup. This somehow contradicts your content and the wish to establish a custom storage. So, it might be a good idea to make your requirements (and options) clear.
Now to the questions in your question. NC generally allows to register a custom storage backend. Starting from there it should be generally possible to create a storage backend using Storj and Co.
I have not done it yet and therefore I cannot give you a good estimate on the involved time. You could have a look though on the app store if there is something already present or if you find any other storage backend that might alloow you to see the involved work (I am considering the S3 storage backend as an example).
Side remark: AFAIK the Storj provides a S3 compatible API. (Please check, I just remember vaguely.) In this case the S3-compatible API might be sufficient and ready to use now.
If you never programmed, the entry is probably quite a chunk to chew. There are a dozen concepts you have to play with, so this is not just done in 1 or 2 days in that case. For an experienced dev and if the API is convenient, it could be hacked together as a ProofOfConcept within few dozen hours. But adding tests and making things work reliable is again quite a challenge.
Chris
Hi @christianlupus , thanks, I will check out if either one is S3 compatible then, and from there work out if I need to and can muster the coding challenge. Admittedly I am new to NC. I want to move out of Big Tech you see. I guess I misunderstood what S3 and co are intended for, thinking “external” = “backup”, but your naming it “backend” means it’s primary, not secondary. I learned a thing 
S3 ist a API specified by Amazon in AWS to site big chunks of data. Each file is somewhat stored as a single URL (veryyyy rough). This makes it simple to access arbitrary large number of files as the length of a URL can be chosen long. Thus, there is virtually no limit on the size.
But we are talking of big data here, so 1024TiB=1PiB and 1024PiB=1EiB and even more than millions of TB! Probably, this is not your use case 
About backup: please be aware, that this is no backup. At least not if used as storage backend. For backup, see 3-2-1 backup. Always test your backup! This is crucial. I once lost TBs of data due to a mis-assumption… Not nice.
Notice the difference between backup and archive: they serve different purposes but have similar ways of implementation.
The point here is: if you use it as storage backend, NC will store its data in the cake d as you upload stuff to it using the web frontend. If you change the data, it is overwritten in the backend as well. So, if your custom script goes havoc or someone steals your credentials of either Nextcloud or the storage, you are out of luck and your data is at stake.
To prevent this, you should have a dedicated copy of the data that NC is not directly working on. Ideally, it is only one time writabrable, long term storage, cheap, and not accessible by nextclout directly
. This minimizes the risk that the backup gets corrupted by bugs and malicious intend.
As this is typically not possible, you might need to use a different approach where you loosen some restrictions.
I just checked and the external files app provides a way to mount S3 die primary storage: server/apps/files_external/lib/Lib/Backend/AmazonS3.php at master · nextcloud/server · GitHub. at least storj is S3 compatible.
Chris
.