Open sergeyprokhorenko opened 3 years ago
Hi. Yes i got implementation from https://github.com/oklog/ulid/blob/master/ulid.go. But idea ULID with sequence seems interesting. We can store shard id. I will append functions on next weekend.
I would not recommend making the shard ID mandatory, as in most cases sharding by timestamp of last use is preferable. Outdated data is archived on a tape drive :)
I think there is a very few data that depends on the Instagram style shard ID (on specific user, product or whatsoever).
Nevertheless, there can be a separate function with shard ID too.
To order ULIDs by creation time, the shard ID must be between the sequence and the random part, or after the random part with increment.
... after the incremented random part.
Hi Dmitriy, Have you implemented the monotonicity of ULIDs within the same millisecond? See: