UUID & Data Integrity
In Pyxis CMS, all primary keys in the database are based on the UUID v4 (Universally Unique Identifier) standard.
Why not use standard IDs (1, 2, 3…)?
Section titled “Why not use standard IDs (1, 2, 3…)?”- API Security (ID Enumeration): Using UUIDs prevents users from “guessing” the URLs of other resources. In a system with integer IDs, changing
/api/users/10to/api/users/11would allow for easy unauthorized access attempts (known as IDOR attacks). - Monorepo Safety: The Next.js frontend operates on unique strings, which hides the internal database structure and prevents data leakage.
- Native PostgreSQL Support: We utilize the native
uuiddata type, which ensures optimal indexing performance while maintaining global uniqueness across different services.