J/Redis UIDs

71 views
Skip to first unread message

David Gonzalez

unread,
Mar 4, 2013, 10:51:30 AM3/4/13
to jedis...@googlegroups.com
System time in MS is not sufficiently unique to act as a reliable key in redis.

Does jedis provide a preferred (fast, mathematically improbably collisions) sufficiently unique ID generator for redis? 

Is a normal Java UUID sufficient, or should i be looking at creating a global::uid and incrementing it, and using that value as my uid?

Thanks

Sam Hendley

unread,
Mar 4, 2013, 10:55:18 AM3/4/13
to jedis...@googlegroups.com
Java UUID is good enough for almost everything. Using global uuid from redis will work but you would have an extra roundtrip to the server each time you wanted a new id. Generally I assume I will use a UUID until proven otherwise.

Sam


--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages