Episode 41 - Blockchain Sharding
In the last episode I spoke about blockchain scalability and how sharding is one of the ways to achieve that. In this episode, let’s do a double click on blockchain sharding.
Sharding, in general, is a term associated with traditional databases. When a database grows too big, it could be divided into smaller databases across several servers based on some property of data. For example, a database with all the names of people in an organization could be divided into 26 servers, each having the names starting with one letter of English alphabet. Each of these servers would be shards of the database. So this is about sharding of databases.
Now let’s consider sharding in blockchains. We know blockchains don’t scale much because all the nodes have to verify all the blocks. Sharding in blockchains is about dividing a blockchain into smaller sub-blockchains and each of these sub-blockchains maintains and verifies their own state. The blocks of these sub-blockchains are produced, validated, and verified by only a subset of nodes. This allows the work to be distributed and not all the nodes have to do all the work. Which, in turn, allows for more scalability and performance.
Sharding in blockchains is being implemented in several ways. Some blockchain platforms have several sub-chains running in parallel and users could use any of these chains for their smart contracts. These sub-chains are also interconnected so that the smart contract and DApps could call each other across different chains.
Some other platforms go a step further to make things more secure by validating the blocks produced by sub-chains using a top-level chain. This allows more security and decentralization while achieving scalability.