News for hackers. Stuff that matters.
Re:Realtime Metrics for 128 Million Users with Redis: 50ms +... by mattparlane on Saturday March 24, 2012 @04:46AM (#3748882)
The only problem with this method is that it requires that IDs are integers, start at 1 and increment by 1.

I'm using MongoDB and IDs are 12-byte values of which the first four are a timestamp. Does anyone know of a way to make this method work, ideally without adding another field to the collection?

Re:Realtime Metrics for 128 Million Users with Redis: 50ms +... by simonw on Saturday March 24, 2012 @06:53AM (#3749052)
The comments on the article address this - the OP is using UUIDs as the primary key for their users, but each user is also assigned an "analytics key" which is an integer that started at one. You can even use the redis INCR command to generate these on demand.
Re:Realtime Metrics for 128 Million Users with Redis: 50ms +... by bluemoon on Saturday March 24, 2012 @07:23AM (#3749090)
There is a way in mongo to replace the id with an auto incrementing number. Have a look at the docs. It's also helpful of you want to use the id as a base62 value for urls