What Is Sharding?
Sharding is a database partitioning technique used to enable scalability in blockchains. It also allows them to process more transactions per second.Sharding splits a blockchain network into smaller partitions, known as "shards." Each shard is composed of its own data, making it distinctive and independent when compared to other shards.
Sharding can help reduce the latency or slowness of a network since it splits a blockchain network into separate pieces. However, there are some security concerns surrounding sharding, which might allow for attacks on the network.
Key Takeaways
- Sharding is a database partitioning technique being considered by blockchain networks.
- The more users that blockchain networks take on, the slower the network becomes, leading to significant latency.
- Sharding can improve network latency by splitting a blockchain network into separate shards—each with its own data, separate from other shards.
- Security concerns surrounding sharding include a hack or shard takeover, where one shard attacks another.
Understanding Sharding
Blockchain networks and their respective cryptocurrencies are gaining in popularity due to the widespread application of the technology, which includes supply chain management and financial transactions. Think of a blockchain as a shared database, where as more and more data is added, the larger and faster the network needs to be to process all of that data efficiently and quickly. It is believed that this is where sharding will improve blockchain performance because it works for database management.
Distributed Nature
The distributed nature of sharding further enhances a technology already decentralized across geographies. Distributing portions of a blockchain to separate nodes allows those nodes to work while other nodes do different work. When combined, the amount of work being done is multiplied.
Scalability
One of the major challenges with blockchain technology is that as additional computers are added to the network and more transactions are processed, the network can become bogged down, slowing the process—this is called latency. Latency is a hurdle to widespread blockchain adoption, particularly compared to the current electronic payment systems, which work quicker and more efficiently.
In other words, scalability is a challenge for blockchains since the networks may not be able to handle the increased amounts of data and transaction flow as more and more industries adopt them.
Sharding is designed in a way that spreads out the workload of a network into partitions, which is believed to help reduce latency and allow more transactions to be processed by the blockchain.
Three traits that blockchain networks continuously seek to improve are decentralization, scalability, and security.But when one or more are increased, others are decreased. This is the blockchain trilemma developers are working to solve.
How Sharding Is Accomplished
Before exploring how sharding is accomplished within a blockchain network, it's important to review how data is currently stored and processed.
Blockchain Nodes
Network nodes process or handle specific tasks for blockchains, depending on the blockchain and type of node. Full nodes store entire copies of a blockchain, and light nodes store and verify block headers. Archive (also called master) nodes store full copies and work to verify blockchains from the first block to the latest.
Sharding removes the need for nodes to store or verify entire blockchains. It splits this requirement among all nodes, freeing up resources for current transactions. The majority of nodes need only to store confirmations.
Ethereum developers and its community were considering sharding at one point but have transitioned to "danksharding." Danksharding uses a second-layer solution to rollup blobs of data off-chain and then send them to Ethereum. The data is then pruned from Ethereum every 18 days.
Horizontal Partitioning
Sharding can be accomplished through the horizontal partitioning of databases through division into rows. Shards, as the rows are called, are conceptualized based on characteristics. For example, one shard might be responsible for storing the state and transaction history for a specific type of address. Also, it might be possible to divide shards based on the type of digital asset stored in them. Transactions involving that digital asset might be made possible through a combination of shards.
Shard Sharing
Each shard is still able to share information amongst the other shards, which maintains a key aspect of blockchain technology—the decentralized ledger. In other words, it is still accessible to every user, allowing them to view all the ledger transactions.
Sharding and Security
One of the main issues in the practice that has arisen is security. Though each shard is separate and only processes its own data, there is a security concern regarding the corruption of the shards, where one shard takes over another shard, resulting in a loss of information or data.
If we think of each shard as its own blockchain network with its authenticated users and data, a hacker (most likely a coordinated group of hackers) could take over a shard. The attacker could then introduce false transactions or a malicious program.
Also, it's important to note that sharding is still in the early testing phase for blockchain networks. As a result, all potential issues and challenges have yet to be worked out.
Does Ethereum Use Sharding?
Ethereum planned to use sharding, but it abandoned those plans in favor of Danksharding, a technique that will use data rollups and blobs sent from a second layer.
What Is the Purpose of Sharding?
Sharding is believed to be a scalability solution for many blockchains. It is thought that sharding will increase transaction throughput and decrease blockchain storage requirements.
What Is Token Sharding?
Token sharding is another name for blockchain sharding.
The Bottom Line
Sharding is a technique used by distributed databases that is being developed and tested by blockchain developers. It is believed that splitting a network and blockchain into shards will increase a network's speed and security and decrease hardware requirements.
The comments, opinions, and analyses expressed on Investopedia are for informational purposes online. Read ourwarranty and liability disclaimerfor more info.