# jetify-com/typeid

By Saurabh Kumar · TIL note, Sep 26, 2026 · Tags: databases, python, architecture

Source: https://saurabh-kumar.com/til/1790424000/

[jetify-com/typeid](https://github.com/jetify-com/typeid) is a spec for Stripe-style IDs: `user_01h2xcejqtf2nbrexx3vqjhp41` is a snake_case type prefix, `_`, then a UUIDv7 in 26 chars of Crockford base32 (hex UUIDs take 36). Time-ordered, so B-tree inserts stay local, unlike UUIDv4. Double-click selects the whole ID, and a serializer expecting `user_` rejects a pasted `post_` ID. Strip the prefix and you get a valid UUIDv7 back, so the database never has to know. Cheap way to adopt: keep the column a native 16-byte `uuid` (`DEFAULT uuidv7()` on Postgres 18, `uuid.uuid7()` on Python 3.14) and encode/decode only at the API edge, e.g. a DRF serializer field on top of [typeid-python](https://github.com/akhundMurad/typeid-python). If PKs are already `uuid`, no schema change, and IDs explain themselves in logs and support tickets.
