3 ms·
I've found ULID to be really useful in my API backend that runs on AWS Lambda and writes to DynamoDB. This is a use case where I need Lambda's parallelism, mean
by radarsat1 3y ago
I've found ULID to be really useful in my API backend that runs on AWS Lambda and writes to DynamoDB. This is a use case where I need Lambda's parallelism, meaning no sharing some common sequential integer. Meanwhile I can roughly order items by creation time which makes pagination and selecting items by time range possible, right on the sort key instead of as a filter. In other words items might end up out of order by a few milliseconds but in my use case that's not a big deal, and I get the benefit of communication-free parallelism.
- sedatk 3y agoI guess that was before UUIDv7 was a thing? Is there a reason to pick ULID over it?
- vlovich123 3y agoThe monotonic version of ULID is probably faster to generate the next number vs UUIDv7. Whether or not that performance difference matters to you is application-specific.
- sedatk 3y agoMonotonic version relies on locking to avoid conflicts. Not applicable in this case.
- vlovich123 3y agoCan't you have a per-thread ULID without any locks?
- gopher_space 3y agoWhat’s wrong with timestamp + worker number in your situation?