UUIDs

Learn about UUIDs and the UUID anti-pattern in PostgreSQL.

We'll cover the following

Anti-pattern

The PostgreSQL data type UUID allows for 128-bit synthetic keys rather than 32 bits with serial or 64 bits with bigserial.

Sequences

The serial family of data types is built on a sequence with a standard defined behavior for collision. A sequence is nontransactional to allow several concurrent transactions to each get their own number, and each transaction might then commit or fail to commit with a rollback. It means that sequence numbers are delivered in a monotonous way, always incrementally, and will be assigned and used without any ordering known in advance and with holes between delivered values.

Get hands-on with 1200+ tech skills courses.