Stream-Framework icon indicating copy to clipboard operation
Stream-Framework copied to clipboard

serialization_id is too long to be used as a score for Redis ordered set

Open Anislav opened this issue 10 years ago • 2 comments

Activities' serialization_id is used as a score for a Redis ordered set by the timeline storage. Redis scores are represented in IEEE 754 double-precision floating-point format. Converting a serialization_id which is 27 symbols long in this format, results in losing precision. This causes filtering activities to work inappropriately in some occasions.

Anislav avatar Jul 17 '14 15:07 Anislav

Hi Anislav; thats right, the default serialization_id implementation is too large to fit in Redis sorted set scores; we are going to add documentation on this and invite users to come up with their own implementation of that.

At this present we are using Feedly ourselves on our own project (getstream.io); there we took a different approach and went for something similar to twitter snowflake (which is pretty much current timestamp + host data + random data).

Unfortunately thats not a good default behaviour either because it breaks most of our users implementations (or at least makes them more complicated).

Tommaso

tbarbugli avatar Jul 19 '14 13:07 tbarbugli

Is this still the case?

TheoRyley avatar Feb 04 '17 00:02 TheoRyley