This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Asking for advice. I found ULID https://github.com/ulid/spec It's kind of compatible with postgres uuid. I'm using de.huxhorn.sulky/de.huxhorn.sulky.ulid {:mvn/version "8.3.0"} from https://github.com/huxi/sulky/tree/master/sulky-ulid Made tiny a wrapper: https://gist.github.com/geraldodev/e3eaef6c4811649bdf05a8775632b5df Configured custom reader tag ulid/id Got to the point that I'm deciding if it's worth to instrument next.jdbc to read uuid from postgres database as ULID or generate an java.util/UUID from an ULID (which is going to be sortable) . Which do you think I should go ? Can you share your experiences with ULID and next.jdbc ?
Note that there's also UUIDv6/v7 which, if all the components of your systems support it, might be a better fit.
@U2FRKM4TW Why ? Can you explain ?
There were a number of schemes of simply lexigraphically sorted ids (flake ids, squuids, ulid, etc) but as of the last few years there are new uuid types intended to cover that case
v7 in particular is almost identical to what ulid proposed there, it just includes the uuid version field as well
Ulid can be used to generate links. Postgres driver already reads uuid type into java.util.UUID so no need for translation.
I really look forward to when PostgreSQL supports type-7 UUIDs. In the meantime, I've been exploring and playing with ULID for several solutions and they work great too! 🙂 It's all good!
You can add uuid v7 and uuid v8 support to PG with these functions: https://gist.github.com/kjmph/5bd772b2c2df145aa645b837da7eca74