Alternative solutions like IPFS/Filecoin Arweave only support immutable data and are mainly suitable for static & immutable data.
Is it also true for greenfield? Does it support data mutability?
Alternative solutions like IPFS/Filecoin Arweave only support immutable data and are mainly suitable for static & immutable data.
Is it also true for greenfield? Does it support data mutability?
Ans:
“”"
Hey Liang,
thanks for the questions, let us reply in the forum directly.
But shortly, greenfield support the deletion of a file, which means that by default a file can be deleted by a user if the user as the right ownership.
In principale If nobody has the access right to delete a file this file would be alive as long as the payment flow to keep the file is active.
“”"
Qns:
“”"
Thanks for the reply
“”"
gnfd://<bucket_name>/[prefix]/[0…n]/object-id
where:
This path should be 1:1 mapped to an object.
It will however be deleting and uploading a new one - not updating. So if you need to update a 1Mb file with 1 byte, you’ll have to upload the whole file again.
Updating usually suggests adding bytes to the existing file, without uploading/rewriting the whole file - this is not possible.
Is data read/write performance tied to block time or independent?
Say if I want to store database blobs on GreenField, since there is only “overwrite”, an I am encouraged to batch and write instead of doing small updates?
independent. The data is uploaded directly to the storage provided. once uploaded, the checksum of the data along with other metadata, like permissions, are recorded to the blockchain - only this last part is tied to the block time
It is fair to say that in this regard, just like IPFS and Arweave, BNB Greenfield is not suitable for mutable data storage directly?
No, the files are immutable so you cannot open an IO channel and change a particular bit. The reason for this is file’s checksum is calculated and written to the blockchain. If editing were allowed, then the system would have to recalculate the whole checksum and redo the replication across all secondary SPs - a lot of overhead. It’s simpler in a way just to rewrite the whole file and delete the old one.
I was thinking about how to build mutable storage on top of immutable storage layer like IPFS, GreenField, Arweave, because overall immutable data is more useful for archiving/backup and not very easy to work with to build dynamic & interactive applications.
By “checksum”, does it mean the file is content-addressed? In comparison, we could retrieve files using CID from IPFS.
Files being immutable totally make senses! So I would assume in order to support mutability, we need another layer of data structure on top of the immutable storage layer the way ipfs mutable filesystem or ethereum contract storage merkletree works…
I think the mutability
support is a useful feature. As files on Greenfield are not contend addressed, it is possible to achieve data update.
I think a simple way to implement the mutable object is that the greenfield can supports object overwrite and object versioning.