Logo
Key Generate Algorithm

KEY GENERATE ALGORITHM #

Snowflake #

Type: SNOWFLAKE

Configurable Properties:

NameDataTypeDescriptionDefault Value
max-vibration-offset (?)intThe max upper limit value of vibrate number, range [0, 4096). Notice: To use the generated value of this algorithm as sharding value, it is recommended to configure this property. The algorithm generates key mod 2^n (2^n is usually the sharding amount of tables or databases) in different milliseconds and the result is always 0 or 1. To prevent the above sharding problem, it is recommended to configure this property, its value is (2^n)-11
max-tolerate-time-difference-milliseconds (?)longThe max tolerate time for different server’s time difference in milliseconds10 milliseconds
worker-id-offsetintThis parameter is suitable for multi-cluster environments to avoid generating duplicate snowflake algorithms. When setting parameter values, please reasonably evaluate the number of nodes required for the cluster0

UUID #

Type: UUID

Configurable Properties: None