in reply to Re^2: How do I get a unique Perl Interpreter ID?
in thread How do I get a unique Perl Interpreter ID?
I'd prefer to not have the IDs longer than they need to be. Something that'd be unique across a single server farm over some fixed interval of time like 100 days is good enough for my purposes.
When I need unique IDs, I usually have a RDBMS running somewhere that has solved all of the nasty race and locking problems. What if you would simply (ab)use a RBDMS, create a sequence there, and get the sequence's nextval whenever you need an ID?
Or, if you work across several RDBMS, you could concat a server ID (IP address or hostname, if you have no better idea) and a sequence number into a locally unique ID.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How do I get a unique Perl Interpreter ID?
by wrog (Friar) on Dec 02, 2011 at 17:21 UTC |