bc https://en.wikipedia.org/wiki/Gossip_protocol


  • 分布式容錯性:分布式網絡極其魯棒,能夠容忍部分節點的異常狀態;
  • 不可篡改性:一致提交后的數據會一直存在,不可被銷毀或修改;
  • 隱私保護性:密碼學保證了數據隱私,即便數據泄露,也無法解析。

隨之帶來的業務特性將可能包括:

  • 可信任性:區塊鏈技術可以提供天然可信的分布式賬本平台,不需要額外第三方中介機構參與;
  • 降低成本:跟傳統技術相比,區塊鏈技術可能帶來更短的時間、更少的人力,降低維護成本;
  • 增強安全:區塊鏈技術將有利於安全、可靠的審計管理和賬目清算,減少犯罪風險。

 

比特幣區塊鏈已經支持了簡單的腳本計算,但僅限於數字貨幣相關的處理。除了支持數字貨幣外,還可以將區塊鏈上執行的處理過程進一步泛化,即提供智能合約(Smart Contract)。智能合約可以提供除了貨幣交易功能外更靈活的合約功能,執行更為復雜的操作。

這樣擴展之后的區塊鏈,已經超越了單純數據記錄的功能了,實際上帶有點“智能計算”的意味了;更進一步地,還可以為區塊鏈加入權限管理,高級編程語言支持等,實現更強大的、支持更多商用場景的分布式賬本。

 

據參與者的不同,可以分為公有(Public)鏈、聯盟(Consortium)鏈和私有(Private)鏈。

公有鏈,顧名思義,任何人都可以參與使用和維護,典型的如比特幣區塊鏈,信息是完全公開的。

如果進一步引入許可機制,可以實現私有鏈和聯盟鏈兩種類型。

私有鏈,由集中管理者進行管理限制,只有內部少數人可以使用,信息不公開。

聯盟鏈則介於兩者之間,由若干組織一起合作維護一條區塊鏈,該區塊鏈的使用必須是帶有權限的限制訪問,相關信息會得到保護,典型如供應鏈機構或銀行聯盟。

目前來看,公有鏈更容易吸引市場和媒體的眼球,但更多的商業價值會在聯盟鏈和私有鏈上落地。

根據使用目的和場景的不同,又可以分為以數字貨幣為目的的貨幣鏈,以記錄產權為目的的產權鏈,以眾籌為目的的眾籌鏈等……,也有不局限特定應用場景的通用鏈。

現有大部分區塊鏈實現都至少包括了網絡層、共識層、智能合約和應用層等結構,聯盟鏈實現往往還會引入一定的權限管理機制。


問題是什么?

This problem appears both in data consistency maintenance and in synchronization of a cluster state (propagation of the cluster membership information and so on). Although the problem above can be solved by means of a global coordinator that monitors a database and builds a global synchronization plan or schedule, decentralized databases take advantage of more fault-tolerant approach. The main idea is to use well-studied epidemic protocols [7] that are relatively simple, provide a pretty good convergence time, and can tolerate almost any failures or network partitions. Although there are different classes of epidemic algorithms, we focus on anti-entropy protocols because of their intensive usage in NoSQL databases.

Anti-entropy protocols assume that synchronization is performed by a fixed schedule – every node regularly chooses another node at random or by some rule and exchanges database contents, resolving differences. There are three flavors of anti-entropy protocols: push, pull, and push-pull. The idea of the push protocol is to simply select a random peer and push a current state of data to it. In practice, it is quite silly to push the entire database, so nodes typically work in accordance with the protocol which is depicted in the figure below.

這個問題當然可以通過global coordinator來解決, 但是decentralized設計可以提供more fault-tolerant approach的設計.

其實算法很簡單, 就是epidemic protocols, 這兒選了在Nosql中廣泛應用的anti-entropy protocols.

image

Push, 問B你有什么和我不同, B告訴我, 我把不同部分push給B

Pull, 告訴B我有什么, B把我沒有的發給我

Push-pull, 把上面兩個同時結合做了, 圖的下面兩條線箭頭畫反了

 

Anti-entropy protocols provide reasonable good convergence time and scalability. The following figure shows simulation results for propagation of an update in the cluster of 100 nodes. On each iteration, each node contacts one randomly selected peer.

image

One can see that the pull style provides better convergence than the push, and this can be proven theoretically [7]. Also, push has a problem with a “convergence tail” when a small percent of nodes remains unaffected during many iterations, although almost all nodes are already touched. The Push-Pull approach greatly improves efficiency in comparison with the original push or pulls techniques, so it is typically used in practice. Anti-entropy is scalable because the average conversion time grows as a logarithmic function of the cluster size.

Although these techniques look pretty simple, there are many studies [5] regarding performance of anti-entropy protocols under different constraints. One can leverage knowledge of the network topology to replace a random peer selection by a more efficient schema [10]; adjust transmit rates or use advanced rules to select data to be synchronized if the network bandwidth is limited [9]. Computation of digest can also be challenging, so a database can maintain a journal of the recent updates to facilitate digests computing.

怎么衡量Anti-entropy protocols, 當然是通過convergence time,  肯定是Push-pull效率最高


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM