Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I really like ULID for this problem (e.g: https://github.com/ahawker/ulid)
- same number of bytes as UUID
- start with a date, so has great locality. Plus you get extra information in the uid that you can extract.
- can be created from an existing date or uuid, and exported to a uuid, so there is a migration path
I've been collecting all my notes on UUIDs here https://github.com/sw-yx/brain/blob/master/R%20-%20Dev%20Not... in case it is helpful to anyone
We evaluated ULID but we wanted something that is future proof for our decentralised secret sharing system. So we implemented UUIDv7 in TypeScript called `IdSortable` https://github.com/MatrixAI/js-id
It allows strict monotonic IDs when you provide it the previously generated ID. The resulting data structure is a Uint8Array making it easy to put into binary structures. Can also be used as a key inside any POJO record.