Posts you want to find years later go here.
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790 Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA
Post
by Peijen » Thu Jun 01, 2006 8:01 pm
How would you implement a distributed lock and increment function? Obvisouly the goal is atomic operation and speed, however given a distributed environment we have to worry about connectivity as well.
Also what other issues I should think about to make sure I am not missing anything?
Jonathan
Grand Pooh-Bah
Posts: 6722 Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:
Post
by Jonathan » Thu Jun 01, 2006 8:57 pm
How many agents?
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790 Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA
Post
by Peijen » Thu Jun 01, 2006 9:59 pm
Don't know, let's say less than 10000.
Jason
Veteran Doodler
Posts: 1520 Joined: Fri Jul 18, 2003 12:53 am
Location: Fairfax, VA
Post
by Jason » Fri Jun 02, 2006 1:54 am
Do you really need a lock and increment? What are you trying to track?
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790 Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA
Post
by Peijen » Fri Jun 02, 2006 2:55 am
Unique ID in sequence
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790 Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA
Post
by Peijen » Fri Jun 02, 2006 2:56 am
Actually after some though, connectivity shouldn't matter too much. If I skipped a number I skipped a number, but I want to keep it at minimum.
Jason
Veteran Doodler
Posts: 1520 Joined: Fri Jul 18, 2003 12:53 am
Location: Fairfax, VA
Post
by Jason » Sun Jun 04, 2006 5:32 pm
Just kind of wondering, but why does the unique id have to be in sequence? Especially if you can skip a number?
I use GUIDs for everything now. It saves enormously on concurrency constraints that aren't necessary.
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790 Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA
Post
by Peijen » Mon Jun 05, 2006 4:04 pm
Hashing, indexing, and searching. GUID is good for hashing but not very good for indexing or searching performance wise.
quantus
Tenth Dan Procrastinator
Posts: 4891 Joined: Fri Jul 18, 2003 3:09 am
Location: San Jose, CA
Post
by quantus » Tue Jun 06, 2006 12:30 am
Peijen wrote: Hashing, indexing, and searching. GUID is good for hashing but not very good for indexing or searching performance wise.
I think you're only trading away O(1) for O(log n) (or whatever your hash time is) for searching and indexing, which shouldn't be too bad.