This article discusses:
- Factors influencing performance of blockchain
- Current blockchain networks and their performance
- The way ahead for blockchain performance and scalability
Performance and scalability of IT systems have always been the key non-functional requirements that are used to gauge the production-readiness of any implementation project. The same is true for a blockchain network, more so because of its distributed and decentralized model that enables peers to collaborate and build trust over a business network. Each peer node must perform computations and communicate with other peers to validate transactions, arrive at consensus and update the state of the shared ledger. It is imperative to be cognizant of the factors affecting blockchain performance and the improvement areas to make informed architectural decisions for a blockchain based solution.
Performance of blockchain networks is generally measured as the average time it takes for a transaction to be validated and stored in each peer node in a way that it cannot be reversed or revoked. While this is often termed as throughput it should not be confused with the number of concurrent transactions processed in a given time frame. Scalability of blockchain networks is the ability of that platform to support increasing load of transactions, as well as increasing the number of nodes in the network.
Factors influencing performance of blockchain
- Consensus mechanism – The technique or mechanism by which a transaction is propagated, validated and finalized in a blockchain network is termed as the consensus protocol or algorithm. And this consensus mechanism is also responsible for achieving a fine balance between the degree of decentralization, scalability and security that a blockchain network possesses. Hence, the choice of consensus mechanism is directly related to how the blockchain network performs.
- Network Latency – In a distributed architecture this is the most important factor affecting the overall performance of the network. When a transaction is to be validated it needs to be broadcast to all the nodes and their response needs to be collated for majority-based consensus. So, having a dedicated network bandwidth goes a long way in minimizing the network delays and improving the overall throughput.
- Node Infrastructure – Blockchain nodes comprise of a runtime engine and a database that is hosted on-premise or on cloud. In the absence of dedicated infrastructure resources (i.e. CPU, memory, hard disk) the node performance is most likely to get hampered. Thus, it is imperative that infrastructure sizing and adequate IOPS (Input Output operations Per Second) allocation is provisioned.
- Number of nodes – As the number of nodes increase, the longer it takes for a transaction to be propagated and consensus to be achieved the more it degrades the overall performance. Techniques to reduce the communication overhead and allow nodes to rely on validation history of a leader node and/or other peer nodes are being introduced to alleviate this problem.
- Smart contract complexity – Most of the benchmarking studies or claims are based on tests conducted in a controlled lab environment for the simplest of transactions. As the complexity of smart contracts increases in terms of the validation logic and the number of reads and writes from/to the ledger increases, the processing latency also increases thus impacting the overall performance.
- Transaction Payload size: Since the transaction and its payload needs to be relayed over the network to all the nodes, bigger payloads take more time for replication across nodes. So one of the best practices is to store the large payloads and documents in an offchain storage, and record their reference on blockchain.
- Node local storage: Typically, blockchain networks support key-value pair datastores to maintain the transaction and state of the ledger. There is a significant amount of read-write that occurs, and the efficiency of the underlying database is a key factor in influencing the performance of the entire network.
- Transaction pooling / queuing – While a blockchain network comprises of multiple nodes and collectively provides high availability but the transaction handling capacity of each individual node determines how many transactions are going to be accepted from the client applications for further processing. And this has a direct effect on the overall throughput of the network.
Current blockchain networks and their performance
Public blockchain networks, such as Bitcoin and Ethereum comprise of millions of nodes and support cryptocurrency transactions. Due to the need of establishing trust between completely anonymous entities, a very compute and time intensive mining-based consensus mechanism is used. Thus, it takes a long time to achieve transaction finality, which results in transaction throughput of single digits. This is why public blockchains provide poor performance and scalability that creates the need to use techniques, such as side chains to offload the transaction processing from the main chain.
For enterprise use cases involving B2B and B2C interactions between known partners, private permissioned blockchain platforms are used to create a consortium with a limited number of nodes. The resultant throughput is much higher because a more efficient consensus algorithm is used that does not need to produce a proof-of-work for committing transactions to the ledger.
There is a new breed of blockchain platforms, also termed as blockchain 3.0, which is based on the principles of DLT (distributed ledger technology). These platforms help resolve the issue of performance and scalability by leveraging data structures, such as Directed Acyclic Graph and reducing the processing latency of transactions through innovative validation and voting mechanisms.
As described earlier there are several factors affecting the performance of blockchain network so benchmarking or performance testing of blockchain is not a straightforward exercise. Moreover, the use case being implemented and the architecture and design of off-chain components in a blockchain-based solution also need to be considered when processing end-to-end business transactions.
Blockchain performance and scalability will continue to be a topic of intrigue and interest in the near future as blockchain technology is adopted and applied for a variety of use cases. There is a significant performance improvement in “blockchain 3.0” networks, though they are yet to see wide scale adoption. But before we embark on our search for a high performing blockchain platform that supports thousands of transactions per second, let us be doubly sure on whether the use case for which the solution is being envisaged requires the same.