Sharding is a traditional concept existing in centralized database management since the end of the 1990s. Sharding reminds me of the divide and conquer paradigm, because with its use developers are able to divide databases huge data in smaller pieces and work on the quality of the system performance and the decrease in the response time of a query. Managing the whole becomes easier when we have the vision divided into smaller, manageable parts.
The term was popularized through the game Ultima Online, an MMORPG (Massive Multiplayer Online Role-Playing Game). In the game, the concept is applied by distributing players across a variety of existing servers, which allows for more efficient traffic management and network capacity for developers.
Today, Sharding continues to be used in the world of games in different ways: separation of maps based on geographic location for FPS games like CS:GO and Valorant, servers to support players of RTS games (Real Time Strategy, in Portuguese, strategy in real time) like Starcraft and Age of Empires, online survival games like Rust and Ark, where it is possible to divide the virtual world into different parts and host them on different servers – collaborating with the quality of internal communications between players on the server, online sports games such as the FIFA series, where players, like FPS players, can be divided into smaller groups based on geographic location, which reduces latency and improves gameplay.
In addition to games, it is also possible to apply Sharding in other areas and contexts that require the processing of large amounts of data in a scalable way, such as: social networks, payment systems, cloud storage, e-commerce, streaming platforms, etc.
How is Sharding used in a blockchain?
To understand how sharding can help increase the scalability of blockchains, it is important to first understand the meaning of a blockchain: the blockchain network is composed of a series of nodes (nodes), which function as individual data servers.
When Sharding is applied to the blockchain, the purpose is to divide the network into individual shards, each of which holds a unique set of smart contracts and account balances. Nodes are assigned to specific shards to verify transactions and operations, rather than each node being responsible for verifying all transactions across the entire network.
We can therefore define that Sharding is the way that blockchains have found to speed up the processing of their transactions. Sharding comes as a scalability solution, since the increasing popularity of a blockchain considerably increases the number of processes on the network derived from transactions, decentralized applications and others. Sharding makes it possible for both execution and validation to take place in parallel, which significantly contributes to network speed.
However, you might be wondering why scalability can be considered an issue in a blockchain and why blockchains should be aware of this issue as soon as possible. Let’s exemplify with a real case, which happened on the Ethereum network.
In 2017, the Ethereum blockchain had 10% of its base congested by the popularity of the CryptoKitties launch and its network traffic became extremely slow.
CryptoKitties is known as the first game based on blockchain technology. In it, it is possible for players to collect and create NFT cat cards. The central idea of the game is based on digital scarcity, each cat has unique characteristics and if you own a cat, it is uniquely yours.
In the game, it is possible to mate two CryptoKitties and generate, based on a genetic algorithm, a puppy with its own characteristics inherited from its parents. In case the concept was confusing, we covered the uniqueness of NFTs in our Bored Monkey NFT feature.
When we look at the percentage of 10% of a congested base, we imagine that the impact should not be great for the platform. However, we must take into account that the event slowed down the entire blockchain structure, hindering even transactions not related to the game – which harms the experience of other investors and can lead to the blockchain losing popularity in the market and subsequently going bankrupt.
Now, if we use Sharding on a blockchain, we can break it down into smaller segments, with teams of nodes responsible for individual segments. In this way, transaction validation can occur in parallel, which increases the speed of the network as a whole. In this way, with Sharding, the processes become more independent instead of being executed in a linear way.
The network’s processing capacity can be significantly increased when using Sharding, allowing it to support more transactions and users, in addition to reducing energy consumption and network operation costs. Decentralization is also increased, allowing more participants to contribute to the security and operation of the network. Furthermore, different shards can be optimized for different use cases or performance requirements, making the network more flexible.
Read more about cryptocurrencies:
- What are altcoins and how are they created?
- Discover the 3 most common cryptocurrency scams and learn how to avoid them
- Brazilian Cryptocurrencies: Get to know the main options available
What are the disadvantages of Sharding?
So far, we have seen some of the advantages of using Sharding on a blockchain network related to scalability, energy efficiency, cost reduction, greater decentralization and flexibility. However, there are also its disadvantages.
Dividing a blockchain into independent sections can create additional complexity for developers and increase security risks. Hackers can more easily take control of a single shard in an attack known as a “single shard takeover attack” or “1% attack”. To combat this risk Ethereum proposed random sampling, in which shard notaries are randomly assigned to different sections and verify the authenticity of blocks.
Among the disadvantages to be considered for the use of Sharding in blockchain are: the complexity of the implementation, which requires technical expertise; the need to reorganize the blockchain architecture; increased latency (communication between shards can be slower than communication within the same shard); possibility of centralization; and security dependent on random selection of shards and detection of malicious attacks.
In summary, despite having some disadvantages, the benefits of sharding such as decentralization, cost reduction and flexibility, can make the implementation worthwhile.
While there are still challenges to be faced in implementing sharding on a large scale, the blockchain community is working on solutions to overcome these obstacles. As blockchain technology evolves and adapts to new challenges, sharding is likely to play an important role in network scalability and increased efficiency. Over time, we can expect more networks to adopt sharding as a solution to scalability, leading to wider adoption and widespread use of blockchain technology.
Translation by Laura Bonci