Tell me why this UUID pattern is stupid

4 points | by yakkasean 7 hours ago ago

3 comments

  • benoau 7 hours ago ago

    It sounds similar to Twitter's Snowflake?

    https://en.wikipedia.org/wiki/Snowflake_ID

    • yakkasean 6 hours ago ago

      It does look similar. I’m confused though how they coordinate sequence bits with only 2^10 (1024) workers. Surely they have more web servers than that, so sequence must be coordinated in a centralized way. Also, this is a 62 bit spec.

      • benoau 3 hours ago ago

        There is source code available for it (although the repo's retired):

        https://github.com/twitter-archive/snowflake/blob/b3f6a3c6ca...

        Basically one big server had a number of threads each requesting the next value in the sequence on that machine. The sequence only had to be unique to that machine and was just a counter of how many tweets since <last whole millisecond>. Tweets per millisecond per server was probably never a huge number, so they were able to share the 10 bits between datacenter id and that counter.