hibernate shard

In this section, you will learn about hibernate shard database architecture.

hibernate shard

In this section, you will learn about hibernate shard  database architecture.

What is shard ?

As the name says shard is the fragment/segment/partition of a database table. A shard is a database architecture which partitioned the database horizontally. Each individual partition is known as shard or database shard. In shards, rather partitioning columns of the database table(normalization), rows of the database table are putting together in separate table. Each partition knows as shard and it can be located on a separate database server or physical location.


A group of Google engineers started Hibernate shards and open sourced this project to get the help from the open source community so as to complete it as soon as possible.

Need of Hibernate shard

Sometimes relation data for a single database table/database is too much  or in a distributed database architecture, network latency is too high (where distance is too far) or sometimes potential client wants their data in its own database. In that case shard is the solution.

Hibernate Shards is designed in such a manner to reduce this complication by providing horizontal partitioning on top of Hibernate Core. It provide unified view of multiple databases.

Key features of Hibernate shard

Some key features of Hibernate shard is given below :

  • Fully supported Hibernate programming model
    Hibernate shard allows you to use Hibernate API and its features without any hassle. If you are familiar with Hibernate, you already know to use Hibernate Shards.

  • Elastic sharding scheme
    Distribution is flexible in Hibernate shard. You can use default sharding strategies or you can distribute data according to your own logic.

  • virtual shards support      
    Later on, if you need to redistributing your data, is a very complex challenge. Hibernate Sharding provides virtual shards which designed to simplify the process of resharding your data.

  • Hibernate Shards has LGPL (Lesser GNU Public License) due to which it is free / open source.