Jump to content

Shard (database architecture)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 210.193.53.1 (talk) at 09:15, 17 October 2008 (In Hibernate). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A Shard is a method of horizontal partitioning in a database.

Shard database architecture

Horizontal partitioning is a design principle whereby rows of a database table are held separately, rather than splitting by columns (as for normalization). Each partition forms part of a shard, which may in turn be located on a separate database server or physical location. The obvious advantages are that the number of rows in each table are reduced (this reduces index size, thus improves search performance). Also if the sharding is based on some real-world aspect of the data (e.g. European customers vs. American customers) then it may be possible to infer the appropriate shard membership easily and automatically, then only query the single relevant shard. [1]

Sharding in practice is obviously far more difficult than this. Although it has been done for a long time by hand-coding (especially where rows have an obvious grouping, as per the example above), this is often inflexible. There is now a desire to support sharding automatically, both in terms of adding code support for it, and for identifying candidates to be sharded separately.

Where distributed computing is used to separate load between multiple servers; either for performance or reliability reasons, a shard approach may also be useful here.

Support for Shards

In Hibernate

Hibernate Shards (as an extension to Hibernate Core) is one of the first persistence frameworks to make explicit support for shards.[2] The purpose of Hibernate Shards is to make the features of sharding available to developers, whilst retaining use of the Hibernate Core API. Adding shards to an existing database is an easy addition in the future, rather than a major refactoring.[3]

See also

References

  1. ^ Rahul Roy (July 28, 2008). "Shard – A Database Design". {{cite journal}}: Cite journal requires |journal= (help) (http://technoroy.blogspot.com/2008/07/shard-database-design.html)
  2. ^ "Hibernate Shards". 2/ 8/2007. {{cite web}}: Check date values in: |date= (help)
  3. ^ "Hibernate Shards".