News for hackers. Stuff that matters.
Re:Asynchronous UIs - the future of web user interfaces by danmaz74 on Wednesday November 16, 2011 @02:10PM (#3244551)
Couldn't you just allocate a pool of IDs to each session (open client), and let the client generate real, unique IDs directly using them? This way you wouldn't need collision detection, synchronization, etc. You only need a big enough IDs space, or a way to reuse IDs of the pool that weren't actually used by the client (by including them in new pools).
Re:Asynchronous UIs - the future of web user interfaces by bchallenor on Wednesday November 16, 2011 @06:24PM (#3245656)
That's what (N)Hibernate calls the hilo algorithm. Compared with GUIDs, it has the advantage that IDs are somewhat sequential. (Random keys are terrible for index fragmentation.)

http://stackoverflow.com/questions/282099/whats-the-hi-lo-al...

Re:Asynchronous UIs - the future of web user interfaces by nazar on Wednesday November 16, 2011 @03:21PM (#3244897)
I am afraid that would create a mess in a db(its just my guess). Though your idea sounds nice to my ears. The hardest part would be if session runs out of id-s I guess. One can never allocate optimal pool of IDs for every user, there are always going to be "bad cases".
Re:Asynchronous UIs - the future of web user interfaces by danmaz74 on Wednesday November 16, 2011 @04:45PM (#3245237)
If the id space is big enough, not having optimal pools wouldn't be a problem. And if you are near the exhaustion of a pool, just request a new one...