We use Postgres and prisma for our Next.js app. Previous developers have used cuid for every table on our schema. For some reasons we are restructuring the tables and I was wondering would it be better to use int ids? Would it result in any performance gain?
What are the tradeoffs between using Int autoincrement id vs cuid for Postgres prisma client?
If you start comparing GUID vs Int ids for Postgres, please quote authentic reference proving that cuid is mapped to guid for Postgres.
A sequence generating bigint values will certainly be faster than even the most efficient CUID or GUID algorithm, and the result will need less storage space.
The only good reasons to use something else like a CUID or GUID are
you have cryptographic requirements to obscure the creation order (but CUID doesn't do that)
you need to generate primary keys outside the database and in a distributed environment