時間:2024-01-31|瀏覽:314
HTTP 與 IPFS,圖片來自 MaxCDN
雖然 HTTP 為我們提供了我們今天所知的互聯(lián)網(wǎng),但它已經(jīng)過時了,并且在 20 多年后,普遍存在的問題變得越來越明顯。
當今 HTTP 實施所產(chǎn)生的關(guān)鍵問題是互聯(lián)網(wǎng)流量大幅增加以及由此產(chǎn)生的壓力點被放大的結(jié)果。
當前HTTP的實現(xiàn)中,出現(xiàn)了如下問題。
一次從單個服務(wù)器下載文件導(dǎo)致內(nèi)容交付效率低下。
昂貴的帶寬成本和文件重復(fù)導(dǎo)致存儲臃腫。
服務(wù)器和提供商的日益集中化導(dǎo)致互聯(lián)網(wǎng)審查制度的加強。
互聯(lián)網(wǎng)上存儲的信息歷史脆弱,網(wǎng)頁壽命短。
間歇性連接導(dǎo)致發(fā)展中國家離線且連接速度緩慢。
問題不勝枚舉,在技術(shù)創(chuàng)新時代,一項已有 20 多年歷史的技術(shù)變得更加明顯過時也就不足為奇了。
IPFS 提供了互聯(lián)網(wǎng)發(fā)揮其真正潛力所需的分布式存儲和文件系統(tǒng)。
在 IPFS 中,您不需要從單個服務(wù)器下載文件,而是要求網(wǎng)絡(luò)中的對等點為您提供文件的路徑,而不是來自中央服務(wù)器的文件路徑。
這使得大容量數(shù)據(jù)分發(fā)具有高效率、歷史版本控制、彈性網(wǎng)絡(luò)以及通過加密散列保護和驗證并在對等網(wǎng)絡(luò)上分發(fā)的內(nèi)容的持久可用性。
所有這些聽起來都很有希望,但它是如何運作的呢?
IPFS 如何工作?
基本上,IPFS 與我們今天所知的萬維網(wǎng)是一個類似的概念,但更像是在單個 Git 存儲庫中交換對象的單個 BitTorrent 群。
文件通過基于 BitTorrent 的協(xié)議分發(fā)。
重要的是,IPFS 作為 Kodemila、BitTorrent 和 Git 的某種組合來創(chuàng)建互聯(lián)網(wǎng)的分布式子系統(tǒng)。
該協(xié)議的設(shè)計提供了互聯(lián)網(wǎng)的歷史版本控制,就像 Git 一樣。
每個文件及其中的所有塊都被賦予一個唯一的標識符,這是一個加密哈希。
通過網(wǎng)絡(luò)刪除重復(fù)項,并跟蹤每個文件的版本歷史記錄。
這會導(dǎo)致內(nèi)容持續(xù)可用,其中網(wǎng)頁不會因為服務(wù)器故障或網(wǎng)絡(luò)主機破產(chǎn)而消失。
IPFS 的工作原理,來源
Further, the authenticity of content is guaranteed through this mechanism and when looking up files, you are essentially asking the network to find nodes storing the content behind the unique identifying hash associated with that content.
The links between the nodes in IPFS take the form of cryptographic hashes, and this is possible because of its Merkle DAG (Directed Acyclic Graphs) data architecture. The benefits of Merkle DAGs to IPFS include the following:
IPFS links file structures to each other using Merkle links and every file can be found by human-readable names using a decentralized naming system called IPNS.
The implementation of Merkle Directed Acyclic Graphs (DAGS) are important to the underlying functionality of the protocol, but is more technical than the scope of this article.
If you are interested in learning more about this aspect of IPFS, you can find much more detailed information on the IPFS Github page and more about how Merkle trees work here.
Each node only stores the content that it is interested in and indexes the information that allows it to figure out who is storing what. The framework for IPFS fundamentally removes the need for centralized servers to deliver website content to users.
Eventually, this concept may entirely push the HTTP protocol into irrelevance and allow users to access content locally, offline. Instead of searching for servers as with the current infrastructure of the Internet, users will be searching for unique ID’s (cryptographic hashes), enabling millions of computers to deliver the file to you instead of just one server.
The current main implementation of IPFS is in Go with implementations in both Python and Javascript on the way. It is compatible with Linux, MacOSX, Windows, and FreeBSD.
Being an open source and community driven project, you can contribute by following the directions and documents on their Github page or operate your own IPFS node.
There are already some important use cases for IPFS and more are sure to arise as the protocol continues to develop. Offering the new, distributed P2P architecture for the Internet comes with its complexities, but the benefits can be seen in everything from massive financial savings in storage and bandwidth to integration with distributed blockchain networks.
Obvious advantages that come with the distributed storage model of IPFS apply to vastly more efficient data storage and immutable, permanence along with it.
網(wǎng)站將不再因服務(wù)器宕機或 HTTP 鏈接鏈中斷而陷入周期性 404 錯誤消息。
此外,在效率方面,研究人員可以獲得顯著的優(yōu)勢,特別是那些需要解析和分析非常大的數(shù)據(jù)集的人。
隨著大數(shù)據(jù)在現(xiàn)代科學(xué)中的普及,IPFS 提供的快速性能和分布式數(shù)據(jù)歸檔將與加速進步相關(guān)。
服務(wù)提供商和內(nèi)容創(chuàng)建者還可以大幅降低向客戶提供大量數(shù)據(jù)的相關(guān)成本。
當前這種范式的迭代受到帶寬成本增加和數(shù)據(jù)提供商因?qū)Φ葏f(xié)議收費而受到阻礙。
通過互連網(wǎng)絡(luò)的集中式基礎(chǔ)設(shè)施交付內(nèi)容的相關(guān)成本只會不斷增加,并創(chuàng)造出一個嚴重低效和進一步集中化的環(huán)境,以試圖克服這些負擔(dān)。
IPFS 使用,圖片來自 Blockchain Mind
此外,服務(wù)器的集中化會導(dǎo)致政府窺探、DDoS 攻擊流行、ISP 審查和私人數(shù)據(jù)出售。
正如 IPFS 的創(chuàng)建者 Juan Benet 所說:“IPFS 上的內(nèi)容可以通過任何不受信任的中間商進行傳輸,而不會放棄對數(shù)據(jù)的控制或使其面臨風(fēng)險?!?/p>
最后,IPFS 與區(qū)塊鏈技術(shù)的集成似乎是完美契合。
在區(qū)塊鏈交易中使用 IPFS,您可以放置??不可變的永久鏈接。
時間戳可以保護您的數(shù)據(jù),而無需將其實際存儲在鏈上,從而減少區(qū)塊鏈膨脹,并為安全的鏈下解決方案提供一種便捷的方法,以幫助區(qū)塊鏈擴展。
IPFS 已被納入許多加密貨幣平臺中,并且有潛力通過提供點對點和分布式文件系統(tǒng)架構(gòu)來共生地幫助行業(yè)擴展,而這種架構(gòu)是幫助支持加密貨幣平臺增長所需的基礎(chǔ)。
結(jié)論
正如您所看到的,IPFS 是一個技術(shù)上和概念上都很復(fù)雜的協(xié)議,它雄心勃勃地希望徹底改變互聯(lián)網(wǎng)上的數(shù)據(jù)交換。
HTTP 本身就取得了成功,并幫助互聯(lián)網(wǎng)達到了今天的宏偉階段,但新技術(shù)正在不斷涌現(xiàn),對改革和分布式基礎(chǔ)設(shè)施的需求也已顯而易見。
帖子什么是 IPFS?
星際文件系統(tǒng):完整的初學(xué)者指南首先出現(xiàn)在 Blockonomi 上。