- What's a ULID vs a UUID?
- ULID: 26-char Crockford base32, timestamp-prefixed, sortable by creation time, collision-free. UUID v4: 36-char hex, purely random. ULID is UUID v7's spiritual predecessor.
- Is it cryptographically random?
- The random portion yes (uses crypto.getRandomValues). The timestamp prefix is deterministic — same millisecond = same prefix.
- When should I use ULID over UUID?
- Databases where you insert and frequently sort by creation time. Index locality is much better with monotonic prefixes. For pure random IDs, UUID v4 is fine.
- Does it work in Postgres/MongoDB?
- Yes — ULIDs are lexicographically sortable as text, work as primary keys, and have libraries for every major database driver.