News for hackers. Stuff that matters.
Re:Streams: a new general purpose data structure in Redis by unkown-unknowns on Monday October 02, 2017 @05:51PM (#15388266)
It might be useful to be able to query by server time regardless of whether your client clock is in sync. You retrieve some set of data and the next time you can ask the server to give you everything newer than x, where x was the highest time stamp you got from the server previously.
Re:Streams: a new general purpose data structure in Redis by rakoo on Monday October 02, 2017 @05:59PM (#15388325)
Yes exactly, you want to ask what is newer than x, where x is the last event you're aware of, but you don't really care about the date and time in that case. If you just store the last id given by redis Streams naively then you don't even care that they're timestamps; at that point my question is, why even bother with the distinction. Just ask for everything after x and be done with it.
Re:Streams: a new general purpose data structure in Redis by lsiebert on Monday October 02, 2017 @07:43PM (#15388905)
Redis also has TIME to get the current server time with milliseconds and the unix time stamp. I'm reasonably sure that's what's being used to get the first part of the ID anyway.
Re:Streams: a new general purpose data structure in Redis by rakoo on Tuesday October 03, 2017 @03:35AM (#15390805)
Ah, I didn't know that. Although the post says that the timestamp of an id might also be the timestamp of the last message, since the clock can go backwards, so in the worst case a client might get some duplicate messages.