Snowflake ID

ID generatorsnowflake-id

Twitter-style 64-bit ids from timestamp, worker id and sequence.

Provider
default
Category
Data
Properties · 5 set by this component
propertytypevaluesrequiredkind defaultthis component
batchSizeinteger—no—inherited
centralboolean—nofalse▸ false
clockRollbackGuard · advancedboolean—nofalse▸ true
managedboolean—nofalseinherited
replicatedboolean—nofalse▸ false
sequenceBits · component propertyinteger—no12inherited
strategyenumuuid | ulid | snowflake | counter | counter-batched | hashyes—▸ snowflake
timeSortableboolean—nofalse▸ true
workerIdBits · component propertyinteger—no10inherited
Rules that apply · 0

Every rule whose selector covers this component's kind or its category. Whether a rule fires depends on the design: its properties, its edges and its groups.

No rule reads this kind yet. That is a gap, not a guarantee.
Use it in a design
nodes:
  - { id: "snowflake-id", component: "snowflake-id" }
Other ID generator products · 4
Source
# yaml-language-server: $schema=../../schema/component.schema.json
# Twitter Snowflake-style id: timestamp, worker id and sequence packed into 64 bits, generated
# locally on each worker; refuses to issue ids when the clock moves backwards.
schemaVersion: "1"
type: "component"
id: "snowflake-id"
kind: "id-generator"
provider: "default"
docs: "https://en.wikipedia.org/wiki/Snowflake_ID"
defaults:
  strategy: "snowflake"
  central: false
  replicated: false
  timeSortable: true
  clockRollbackGuard: true
properties:
  workerIdBits:
    type: "integer"
    default: 10
  sequenceBits:
    type: "integer"
    default: 12

The same page as markdown, for an agent: /catalogue/components/snowflake-id.md