Cloud storage in the future: Filecoin network in the end is how to work?

Today to talk about, Filecoin network in the end is how to work?

17634387-e330359e06982415.jpg
Jane from the bottom of the picture book App

1, to split a single file into several 256KB sized blocks (Block, this can be understood as a sector);

2, block by block (block) calculation block hash, hashn = hash (blockn);

3, put all together into a block hash array, and then calculate a hash, it will have the final hash file, hash (file) = hash (hash1 ...... n), and the hash (file) and block hash array " bundled "together to form an object, the object as an index structure;

4. Place the block, the index structure to upload all IPFS node (where the first does not describe the details), the file will be synchronized to the network IPFS;

5. The Hash (filecoin) printed out by the read time;

PS: Here you can see the hash IPFS calculation documents are, in fact, and we usually calculate the hash of a different way, but the end result is not the same!

studio

There is also a similar missing a small file processing logic, file system, and the like NTFS, small files (less than 1KB) files, data content will directly IPFS Hash (index) put together to upload IPFS node will not additional occupy a block of size.

Now, has the raw data files and index files (ie hash) IPFS uploaded to the network. As already mentioned, IPFS space is not supported by the recovery of the documents can be synchronized to IPFS, will be a permanent presence. Looks like this will provoke a serious consequence is that, if you frequently edit large files, edit each time we must re-synchronization, would not be excessive waste of space?

for example:

There is a large local file 1G of File1, has been synchronized to IPFS, and behind the back of this document File1 added content 1K, and now need to re-synchronize the files, space should be doing it takes: 1G + 1G + 1K;

However, it is not. IPFS when storing data, the same data is stored only once, the file is divided blocks (block) storage, hash same block, only stored once, it is to say, in front of 1G content did not change, in fact, not IPFS these data will be assigned to the new space will only allocate a new block of data for the last 1K, and then re-upload hash, the actual space occupied is: 1G + 1K;

There are many different file duplicate data, such as subtitles in different languages ​​of the same movie, video section, only the title part is not the same, when two people from different countries in the same movie when uploading these files in block (block), when there is most likely block of hash is the same, these block on IPFS will only store a copy, so that there might be a lot of index files point to the same block, this constitutes a data structure of the aforementioned --Merkle DAG (the Merkle directed acyclic graph).

January Jones

Because all of the indexes are saved hash, so Merkle DAG has the following characteristics (Pa down from the white paper):

1. The content addressable: All contents are multiple hash checksum is uniquely identified, including links.

2. can not be tampered with: all of the content with its checksum to verify. If the data has been tampered with or damaged, IPFS be detected.

3. Deduplication: duplicate content and stored only once.

Reproduced in: https: //www.jianshu.com/p/a0937729ec6a

Guess you like

Origin blog.csdn.net/weixin_33743248/article/details/91146908