Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sophie0000 opened this issue Jul 5, 2024 · 2 comments
Open

Comments

@sophie0000
Copy link

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

@wl102
Copy link

wl102 commented Oct 29, 2024

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

@mehmetolgundev
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants