snowflake icon indicating copy to clipboard operation
snowflake copied to clipboard

If it is the same timestamp, the generated IDs will be the same

Open sophie0000 opened this issue 1 year ago • 2 comments

If it is the same timestamp, the generated IDs will be the same

sophie0000 avatar Jul 05 '24 12:07 sophie0000

if you have more than one *snowflake.Node, like this node, err := snowflake.NewNode(nodeId) make sure they have different nodeId.

wl102 avatar Oct 29 '24 14:10 wl102

The generated id consists of 3 parts;

  1. timestamp
  2. node id
  3. 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.

mehmetolgundev avatar Nov 16 '24 12:11 mehmetolgundev