https://github.com/koblas/pysnowflake
Snowflake generates unique int64 ids that (unlike uuids) are loosely time sorted. Each id consists of:
| Bits | Field | Notes |
|---|---|---|
| 41 | Timestamp in MS | ~70yrs |
| 5 | Datacenter ID | 0~31, default 0 |
| 5 | Worker ID | 0~31, default 0 |
| 13 | Sequence ID | sequence to disambiguate requests in the same ms |
docker run -d -p 9000:9000 ecarpo/snowflake
use DATACENTER_ID & WORKER_ID environment.
docker run -d -p 9000:9000 -e DATACENTER_ID=1 -e WORKER_ID=1 ecarpo/snowflake
/id/<USERAGENT> -- get a unique ID, <USERAGENT> is provided for metrics purposes
/timestamp/ -- get the current timestamp for this host
/datacenter/ -- get the data center identifier for this process
/worker/ -- get the data center identifier for this process
Content type
Image
Digest
Size
330.7 MB
Last updated
about 6 years ago
docker pull ecarpo/snowflake