You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, but does it always work even if we're running a million requests in parallel on a multi-CPU system?
I did read that CUID wasn't the best for this, it's a k-sortable, which only has guarantees on less than 10 000 items, and the guy who wrote the lib recommended using created_at instead. When I tried with created_at it wasn't always working though, I guess the date isn't precise enough as it's only milliseconds.
Ok, but does it always work even if we're running a million requests in parallel on a multi-CPU system?
I did read that CUID wasn't the best for this, it's a k-sortable, which only has guarantees on less than 10 000 items, and the guy who wrote the lib recommended using created_at instead. When I tried with created_at it wasn't always working though, I guess the date isn't precise enough as it's only milliseconds.
https://github.com/paralleldrive/cuid?tab=readme-ov-file#monotonically-increasing-ids
Maybe it's overkill, but the fix should be easy enough. Using this as id stores time in microseconds:
The text was updated successfully, but these errors were encountered: