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.  [ 3 posts ] 
Author Message
 Post subject: Globally unique ids
PostPosted: Fri Apr 04, 2008 11:37 am 
Regular
Regular

Joined: Wed Aug 15, 2007 7:37 am
Posts: 73
Hi,

As part of a system I'm designing we have a requirement to be able to insert rows on multiple servers and later merge them without id translation (effectively multi-master replication). We're using MySQL and NHibernate.

The options boil down to some equally unpleasant ones -
- a dual part key with an identity column and a location column, which as I understand NHibernate won't support and InnoDB doesn't support either

- use MySQL auto_increment_offset and treat as a normal identity column in NHibernate. This has the advantage of putting the onus on the database to make sure things work, but is fragile if the config is set up wrongly

- stored procedures to generate ids - this seems like reinventing the wheel for some reason

I can't find any definitive advice on this, but it must be a solved problem. Does anyone have any advice?

Thanks!

Steve


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 05, 2008 1:16 pm 
Newbie

Joined: Tue Apr 01, 2008 8:55 am
Posts: 4
Is there a reason you don't want to use a UUID (supported by NHibernate)? It seems like it would address your situation.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 10:53 am 
Regular
Regular

Joined: Wed Aug 15, 2007 7:37 am
Posts: 73
I believe the two main reasons we were against it were bad performance under MySQL and because MySQL replication doesn't deal with UUIDs properly, but we might have to take another look at them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.