Snowflake ID
ID generatorsnowflake-id
Twitter-style 64-bit ids from timestamp, worker id and sequence.
- Provider
- default
- Kind
- ID generator
- Category
- Data
- Official docs
- https://en.wikipedia.org/wiki/Snowflake_ID
| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| batchSize | integer | — | no | — | inherited |
| central | boolean | — | no | false | ▸ false |
| clockRollbackGuard | boolean | — | no | false | ▸ true |
| managed | boolean | — | no | false | inherited |
| replicated | boolean | — | no | false | ▸ false |
| sequenceBits | integer | — | no | 12 | inherited |
| strategy | enum | uuid | ulid | snowflake | counter | counter-batched | hash | yes | — | ▸ snowflake |
| timeSortable | boolean | — | no | false | ▸ true |
| workerIdBits | integer | — | no | 10 | inherited |
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.
nodes:
- { id: "snowflake-id", component: "snowflake-id" }# 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