Introduction to hibernate shard

Source: Internet
Author: User

Horizontal and vertical segmentation in DatabasesHttp://blog.csdn.net/haydenwang8287/archive/2010/02/24/5321600.aspx

 

Hibernate shardsA 20% project originated from a small engineer team at Google. It provides a horizontal database split solution.
hibernate shards extends hibernate core to reduce complexity. It can be divided into two parts in concept.
1. basic logic
• Org. hibernate. session
• Org. hibernate. sessionfactory
• Org. hibernate. criteria
• Org. hibernate. query
is extended.
• Org. hibernate. shards. session. shardedsession
• Org. hibernate. shards. shardedsessionfactory
• Org. hibernate. shards. criteria. shardedcriteria
• Org. hibernate. shards. query. shardedquery
you can easily use it, just like a common hibernate application.
2. Application logic
provides three interfaces for processing specific implementation policies.
• Org. hibernate. shards. strategy. selection. shardselectionstrategy
• Org. hibernate. shards. strategy. resolution. shardresolutionstrategy
• Org. hibernate. shards. strategy. access. shardaccessstrategy
Shardaccessstrategy:
Data retrieval policies include:
Sequentialshardaccessstrategy: sequence policy
Parallelshardaccessstrategy: concurrency Policy
If you want to retrieve only one database Sessionfactory. Currently, the policy does not support retrieving one or more databases.
All databases are involved.
Shardselectionstrategy:
When a new data is saved, it is decided to store it in that database.
Shardresolutionstrategy:
After the data is modified, determine the database to which the data is synchronized.

Official documentation

Http://docs.jboss.org/hibernate/stable/shards/reference/en/html/index.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.