The startup's Postgres survival guide(hatchet.run)
437 points by abelanger 1 day ago | 198 comments
tl;dr: A Hatchet engineer distills two years of production Postgres experience into a practical guide covering schema design, indexing, query planning, and connection pooling, with an emphasis on avoiding sequential scans and keeping transactions short. The doc also digs into intermediate and advanced topics like tuning autovacuum to prevent bloat and transaction ID wraparound, batching writes for ~10x throughput, using FOR UPDATE SKIP LOCKED for job queues, and partitioning for time-series data. Includes tips on safely migrating large tables using triggers and batched backfills outside transactions.
HN Discussion:
  • Adds technical corrections and refinements like using uuidv7, deterministic lock ordering, and explain generic_plan
  • Guide omits critical topics like backup/restore strategy that should come first
  • ~Guide underemphasizes monitoring and alerting which are essential from day one
  • Guide is just a subset of the manual without clear prioritization for startups
  • Postgres is too expensive for frugal bootstrappers compared to serverless alternatives