In this article, I will explain what Sharding is, how it works, what pros does it have, and what are the downsides of this concept.
What is Sharding?
Sharding represents the process of splitting a database horizontally in order to spread the load, being a common concept in computer science since the early 1990s. In the case of a blockchain, sharding is meant to lower network congestion and increase transactions per second as it creates new chains, called “shards.”
By breaking the blockchain network into individual segments, aka shards, each segment is going to have a unique set of smart contracts and account balances. Furthermore, nodes are then assigned to individual shards in order to verify transactions, instead of having them responsible for checking every transaction on the entire network.
The whole point is that, if you break up the blockchain into smaller segments, the throughput of transactions would increase, thus overcoming the typical scalability problems that a blockchain usually deals with.
A blockchain that uses sharding relies on a PoS consensus algorithm.
How Does Sharding Work?
Sharding can be achieved by dividing network nodes into groups and splitting the information found in the network between those groups. In other words, you “slice” the database into “shards.” Every shard comes with different characteristics, so that they can’t be confused with one another.
One method refers to the horizontal partition of the database, aka dividing into rows. When this is done, the rows will include only shards with a certain type of information, so you can divide shards based on the smart contracts held.
Another method is the organization of network nodes in a way in which a central relay network is created so that all shards are able to communicate with each other. This means that each shard can keep its information and share it when needed via a relay.
Communication between shards is highly important as it allows all users of a network to access the information stored in the blockchain.
What Pros Does Sharding Have?
The most important aspect that comes with sharding is its improved scalability. Thanks to sharding, a higher number of nodes and larger quantities of information can be connected on a blockchain, without having the speed of transactions affected greatly.
As a result, different sectors could be interested in adopting blockchain technology, as it could get the job done faster. If the transaction is faster, blockchain-based fintech companies have a better chance at competing with centralized payment applications.
Other benefits include better accessibility to users and a higher network participation, as it is expected sharding could even be done on a smartphone or personal computer, thus encouraging people to join.
What Cons Does Sharding Have?
Obviously, as with anything else, sharding also has its downsides.
The main one is the possibility of increasing security risks. Some examples include a shard taking over, or the collusion between shards. If this were to happen, information could be lost completely or partially, or corrupted data can enter the network via a malicious shard.
This is dealt with on Ethereum 2 by assigning nodes to shards randomly and assigning them at irregular intervals.
Sharding is a method of lowering the congestion of a network and increasing the number of transactions that can be made on a blockchain – all by simply dividing blocks. While it does have some big pluses, like an improved scalability, it still has some downsides that need to be worked on, mainly those related to security.