[hibernate-dev] [Search] Dynamic sharding configuration
Hardy Ferentschik
hardy at hibernate.org
Mon Oct 7 13:26:51 EDT 2013
On 7 Jan 2013, at 5:03 PM, Sanne Grinovero <sanne at hibernate.org> wrote:
> I've tried hard to find an agreement on this, but it seems we're
> wasting time without making progress.
> I'm not happy in ignoring a strong recommendation from any of you,
> very hard choice :-(
In the end it is your call. I tried to give arguments for my position, but we seem
to have general disagreement on how to develop/evolve an interface.
If you want to have a specific method for deletion I recommend:
String getShardIdentifierForAddition(Class<?> entityType, Serializable id, String idAsString, Document document);
String getShardIdentifierDeletion(Class<?> entityType, Serializable id, String idAsString);
So I would re-add the suffixes 'ForAddition' and 'ForDeletion'. Also I'd change the return type of
getShardIdentifierDeletion.
I test would be nice as well. Maybe if we see an actual example coded out we would have a better ground
for discussion.
Also, what are the concerns here? Performance, because I target all shards for deletion or security, aka
a deletion is send to a shard which potentially belongs to a different customer.
What is the actual performance gain between the two different scenarios? A factor of 2, 4, 10?
> I'm inclined to add the method back, so that it's the users choice to pick his battle.
A poor choice imo.
> Of course our template implementation could provide a sensible default
> method, so all users looking for simplicity don't need to bother too
> much about the extra method.
So now we use the abstract template class as an excuse to have a mediocre interface. If anything this
is a reason for me to dislike the template implementation even more.
--Hardy
More information about the hibernate-dev
mailing list