-
Book Overview & Buying
-
Table Of Contents
Blockchain with Hyperledger Fabric - Second Edition
By :
In Chapter 1, Blockchain – An Enterprise and Industry Perspective, we introduced the CAP theorem in the context of general system properties. Formally, the CAP theorem as postulated by Eric Brewer in 2000 at ACM Symposium on Principles of Distributed Computing (PODC) (https://dl.acm.org/citation.cfm?id=343502) states that in a distributed data store it is impossible to guarantee more than any two of the following three properties: consistency (C), availability (A), and partition tolerance (P). A distributed data store thus can be characterized on the two properties it guarantees, namely CA, CP, or AP.
More specifically, the theorem is aimed at distributed systems deployed across unreliable networks (networks with faults and delays, such as the internet), leading to a partitioning of the system components. According to CAP, in these environments, the system design must focus on the balance between availability and consistency. For example, the ACID (atomicity, consistency, isolation, durability) approach, typically provided by relational database management systems (RDBMSes), guarantees consistency on a single node at the expense of availability across multiple nodes (CP systems). However, note that different configurations may yield different combinations, namely CA or AP, as well.
In contrast, Fabric is designed, similarly to many other blockchain platforms, as an AP type of system with eventual consistency, also referred to as BASE (basically available, soft state, eventual consistency).
In the context of blockchain, CAP properties can be defined as follows:
Fabric achieves the CAP properties as follows:
As you can see, availability and partition tolerance (the AP properties of the CAP theorem) are guaranteed by default in most blockchain systems. However, consistency is harder to provide.
Fabric achieves consistency by combining the following elements:
ReadSet. The MVCC validation guarantees consistency of the resulting ledger and of the world state and prevents attacks such as double spending. However, it can also lead to the elimination of otherwise valid transactions that have been submitted in an order violating the ReadSet version validation check. The transactions are then marked either valid or invalid in the ledger.To round off the chapter, we'll cover a few new features that have been introduced with the most recent version of Hyperledger Fabric.