(N)Hibernate Shards Topicus & (Distributed) Databases
Wattes? <ul><li>&quot;You can't always put all your relational data in a single relational database. Sometimes you simply ...
Hibernate Shards <ul><li>Standard Hibernate programming model </li></ul><ul><li>Flexible sharding strategies </li></ul><ul...
Hibernate Shards <ul><li>Hibernate + Shards </li></ul><ul><li>  </li></ul><ul><li>ShardedSession </li></ul><ul><li>Sharded...
Recipe for Hibernate Shards <ul><li>Definieer de shards in de configuratie </li></ul><ul><li>Definieer de Id generator in ...
Distributed? <ul><li>Virtual Shards (Gevaarlijk!) </li></ul><ul><li>Welk object moet waar? </li></ul><ul><li>Wat moeten we...
Nadelen <ul><li>Id generatie werkt niet via JPA </li></ul><ul><li>A en B (met een relatie tussen elkaar) mogen niet op apa...
Vragen <ul><li>? </li></ul>07-06-09
Upcoming SlideShare
Loading in...5
×

Hibernate Shards

640

Published on

Topiconf 2007

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
640
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Hibernate Shards

    1. 1. (N)Hibernate Shards Topicus & (Distributed) Databases
    2. 2. Wattes? <ul><li>&quot;You can't always put all your relational data in a single relational database. Sometimes you simply have too much data... Whatever your reasons, talking to multiple relational databases inevitably complicates the development of your application.“ </li></ul><ul><li>http://www.hibernate.org/414.html </li></ul>07-06-09
    3. 3. Hibernate Shards <ul><li>Standard Hibernate programming model </li></ul><ul><li>Flexible sharding strategies </li></ul><ul><ul><li>ShardAccessStrategy </li></ul></ul><ul><ul><li>ShardResolutionStrategy </li></ul></ul><ul><ul><li>ShardSelectionStrategy </li></ul></ul><ul><li>Support for virtual shards (Resharding) </li></ul><ul><li>Free/open source </li></ul>07-06-09
    4. 4. Hibernate Shards <ul><li>Hibernate + Shards </li></ul><ul><li>  </li></ul><ul><li>ShardedSession </li></ul><ul><li>ShardedSessionFactory </li></ul><ul><li>ShardedCriteria </li></ul><ul><li>ShardedQuery </li></ul><ul><li>Hibernate </li></ul><ul><li>Session </li></ul><ul><li>SessionFactory </li></ul><ul><li>Criteria </li></ul><ul><li>Query </li></ul>1 2 1
    5. 5. Recipe for Hibernate Shards <ul><li>Definieer de shards in de configuratie </li></ul><ul><li>Definieer de Id generator in mappings </li></ul><ul><ul><li>ShardedTableHiLoGenerator </li></ul></ul><ul><ul><li>ShardedUUIDGenerator </li></ul></ul><ul><li>Instantieer de ShardStrategyFactory </li></ul><ul><li>Gebruik de sharded factory op de plaats van de gewone </li></ul>
    6. 6. Distributed? <ul><li>Virtual Shards (Gevaarlijk!) </li></ul><ul><li>Welk object moet waar? </li></ul><ul><li>Wat moeten we doen als we mappings aan moeten passen?? </li></ul><ul><li>Tip: Vooraf extra virtual shards </li></ul>
    7. 7. Nadelen <ul><li>Id generatie werkt niet via JPA </li></ul><ul><li>A en B (met een relatie tussen elkaar) mogen niet op aparte shards leven. </li></ul><ul><li>Base types niet als identifier </li></ul><ul><li>Replicated data alleen read-only. </li></ul><ul><li>Sorteren in criteria kan niet </li></ul><ul><li>Geen HQL. </li></ul>
    8. 8. Vragen <ul><li>? </li></ul>07-06-09

    ×