-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Sharding over TABLES with Hibernate and (preferably) JPA
PostPosted: Wed May 11, 2011 6:43 pm 
Newbie

Joined: Wed May 11, 2011 6:36 pm
Posts: 8
Hi,

my current task is to persist messages into a database table. To make this database more performant our dba wants me to use a new table per day.

I know that hibernate shards allows me to partition my data over mutliple databases but (afaik) i can't change the table name that is used for each shard and it doesn't look like i can add shards at runtime.

Is there a way to do what my dba wants with hibernate? What would be best practice for a requirement like this?

Greetings,
Laures


Top
 Profile  
 
 Post subject: Re: Sharding over TABLES with Hibernate and (preferably) JPA
PostPosted: Sun May 15, 2011 10:51 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
it's true that in some cases that's a good trick, but many database engines are able to map this kind of sharding "behind the scenes": i.e. you'll always deal with the same table name, but it will be physically stored in different zones according to any custom sharding rule.

With Hibernate you could do that by customizing the Persister (see annotation options @org.hibernate.annotations.Entity(persister=yourImplementationClassName) ), or in case you're never interested in loading older than today data it might be simpler to generate the table name for today dynamically by extending your Dialect.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.