Choosing a Postgres Primary Key

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • sequential-uuids

    generator of sequential UUIDs

  • Disclaimer: not a dba so my terms might not be appropriate

    I’ve seen uuid4 which replaces the first 4 bytes with a timestamp. It was mentioned to me that this strategy allows postgres to write at the end of the index instead of arbitrarily on disk. I also presume it means it has some decent sorting.

    [inspiration](https://github.com/tvondra/sequential-uuids/blob/master/sequ...)

  • spec

    The canonical spec for ulid

  • I use ULID, 128 bits, time and great sorting

    https://github.com/ulid/spec

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • pg_tle

    Framework for building trusted language extensions for PostgreSQL

  • >pg_idkit to their list of supported extensions

    For some of these simpler extensions, we're looking at using AWS's TLE (https://github.com/aws/pg_tle), which would allow user-contributed extensions. If we can pull that off, we'll probably look again at the current set of extensions we offer and then see which ones can be ported to a TLE instead

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts