Sharding technology

What is Sharding and How It Works

One of the most difficult tasks for developers of any database is scaling. When the volume of data and operations with them grows, you need to increase the performance of the system in one way or another.

Sharding is a database scaling technology, the basic idea of which is to break the database into separate segments, each of which can be placed on a separate server.

Applying this technology to blockchain, sharding is the division of the network into separate sectors. Each sector (shard) contains a unique set of smart contracts and account balances, and each shard is assigned certain nodes in the network. These nodes are responsible for verifying transactions in that shard only, not all transactions on the blockchain.

What problems sharding solves

The more popular a project becomes, the more users it attracts, and they, in turn, conduct a lot of transactions, launch dApps and other processes on the network. As a result, the speed of transactions drops, commissions grow, and all this becomes an obstacle for the expansion and development of the project in the future. Dividing the network into shards (also called shards) allows you to increase the capacity of the blockchain and thus solve this problem.

When a group of nodes is responsible for a specific segment of the registry, each node in the network no longer needs to maintain the entire blockchain to perform each transaction. Transaction validation is performed in parallel rather than linearly, which increases network throughput. As a result, the scaling problem disappears.

In addition, in blockchains that utilize sharding, due to load reduction, nodes run more efficiently without increasing computational power.

How it all works

Blockchains are made up of thousands of computers, whose computing power enables distributed registries to function: conducting transactions, executing smart contracts, deploying dApps, etc.
If the network functions on the basis of sequential execution, each node must process each transaction. Therefore, verification of transactions takes quite a long time. For example, Ethereum processes about 10 transactions/sec.

Adding nodes to a blockchain does not mean that its performance will increase. It just means that the verification chain will become longer.

The essence of sharding is to abandon the linear execution model in favor of a parallel one, in which shards do only certain calculations and process a large number of transactions simultaneously. Such blockchains in the blockchain, all information from which is transferred to the main blockchain, but already in a reduced form.

Minuses of sharding

The main problems of sharding are two: communication between shards and security.

Communication.If we divide the network into isolated shards, each shard will essentially become a separate blockchain. Users and decentralized applications of one shard will only be able to communicate with users and applications of another using a special communication protocol.
Security. In a segmented network, it is much easier to take full control of a single shard, as it requires much less hash rate than taking over an unallocated network. For example, a 51% attack on a Bitcoin network would require billions of dollars in hardware and hundreds of millions of dollars a day in electricity.Expensive, unprofitable, unfeasible.Taking over a single shard, on the other hand, is much cheaper and easier.

Which networks are already using sharding

The first network to implement sharding is Zilliqa. It positions itself as a blockchain platform that aims to use segmentation to solve scalability problems.In its testnet phase, it was able to achieve a figure of 2,828 transactions/sec.

The Near blockchain ecosystem calls itself a “sharded blockchain on PoS” and claims that their sharding technology enables nodes to stay small enough to use a low-performance device to operate.
Ethereum is also looking to implement sharding technology. Other sharding networks include Cardano, QuarkChain, and PChain, among others.

Bottom line

In theory, sharding technology could finally solve the blockchain trilemma – if it overcomes the challenges it faces.

Blockchains could then be scaled without sacrificing decentralization or security.

More From Author

trading

Recommendations for Testing Blockchain Applications

development

Blockchain Development Tools