Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You have to use Redis' INCR to generate the UUIDs.


That does not help at all with the issue at hand.

The problem is not colliding UUIDs, it is a race condition between getting the list of IPs and then writing them to redis.


Oh, well in the pseudo(?) code he seems to push the content from temp lists into the main list, so it seemed that as long as you have separate temp lists for A,B you wouldn't lose anything, but I probably misread it.

But anyway, as the other comment mentions, there is some transaction support http://redis.io/topics/transactions

I'm not sure how much Redis will focus on transactions but if it doesn't you're out of luck or reinvent the SQL wheel on top of it.


Is it neccessery to use UUIDS? Why not use Redis sets instead of list so we'll get rid of key duplication problem?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: