snowflake
snowflake copied to clipboard
If it is the same timestamp, the generated IDs will be the same
If it is the same timestamp, the generated IDs will be the same
if you have more than one *snowflake.Node, like this
node, err := snowflake.NewNode(nodeId)
make sure they have different nodeId.
The generated id consists of 3 parts;
- timestamp
- node id
- sequence number (step id) Even if you use the same node number for the different id generations, check the StepBits value because it provides generation different ID in the same timestamp. But the best practice is using nodeIDs different each other.