- Shard (database architecture)
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. cite journal
title=Shard – A Database Design
author=Rahul Roy
date=July 28, 2008 (http://technoroy.blogspot.com/2008/07/shard-database-design.html )]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.cite web
title=Hibernate Shards
url=http://shards.hibernate.org/
date= 2/ 8/2007] The purpose of Hibernate Shards is to make the features of sharding available to developers, whilst retaing use of the Hibernate Core API. Adding shards to an existing database is an easy addition in the future, rather than a majorrefactor ing.cite web
title=Hibernate Shards
url=http://www.hibernate.org/hib_docs/shards/reference/en/html/]See also
*
shared nothing architecture References
Wikimedia Foundation. 2010.