News for hackers. Stuff that matters.
Re:Realtime metrics using Redis bitmaps by yread on Wednesday November 30, 2011 @02:48AM (#3294213)
How do they know that user ids are contiguous?
Re:Realtime metrics using Redis bitmaps by darklajid on Wednesday November 30, 2011 @08:47AM (#3294975)
The same way the length of a meter is known. By defining it. They are measuring visitors, they can assign any numbers they like to those.

In my (limited) use cases for redis which interfaced with external information like that I usually had a mapping table anyway, to get something like

users:nameFromExternalSource:myIncrementalId

foo:myId:ThatUsersFoo

bar:myId:ThatUsersBar

Note again that I'm no expert on redis. There might be problems with that approach that I don't know about - but for me this worked out quite well and seemed to save memory vs any foo:externalIdOrUsername:dataHere name scheme.