
TL;DR
A practical look at the operational Postgres guide that hit the HN front page - what it gets right, what the community pushed back on, and what every startup should internalize about running Postgres in production.
Alexander Belanger, co-founder of Hatchet, published The startup's Postgres survival guide yesterday and it hit the Hacker News front page with 135 points. The post distills two years of production Postgres battles into a structured reference, and the HN discussion that followed added a dozen real-world corrections and expansions. Here is what the article covers, what the community added, and what it means for teams still learning to keep Postgres upright.
The guide is organized into three tiers: simple stuff (schemas, queries, indexes, migrations, connections), intermediate (query planner, bulk writes, autovacuum), and advanced (FOR UPDATE SKIP LOCKED, partitioning, large table migrations). Belanger writes from the position that most startup engineers start knowing "if a query is slow, you need an index" and need a path from there to actually running Postgres at scale.
The concrete advice is hard to argue with. Use identity columns or built-in UUIDs for primary keys. Always use timestamptz. Keep transactions short. Use CREATE INDEX CONCURRENTLY to avoid locking writes. Default autovacuum settings can kill your database. Belanger demonstrates real throughput numbers: batching writes can 10x your insert performance, and FOR UPDATE SKIP LOCKED is the right primitive for implementing a job queue directly in Postgres.
What makes the guide useful is that it explains the why behind each rule. The autovacuum section walks through dead tuples, transaction ID wraparound, and why monitoring autovacuum runtimes matters. The query planner section frames seq scans as an economic tradeoff, not a failure: sometimes Postgres estimates a sequential scan is cheaper than the index + heap lookups, and you need to accept that or restructure the query.
The discussion on the HN thread produced substantive pushback and additions across several areas.
Monitoring and alerting. The top comment from thundergolfer noted the guide focuses on prevention but skips detection: "Postgres has a few key failure modes that you want to avoid ever happening, and you can use alerting to get early warning that you are in danger of it happening." This is a fair gap. A survival guide should include what to watch for beyond autovacuum runtimes - connection pool exhaustion, replication lag, and growing dead tuple ratios.
Backup and restore. theallan pointed out the obvious omission: "Should one of the first things you do with a database not be to have a backup strategy?" Backup and restore are absent from the guide. For a startup, a production database without a verified restore plan is one deploy away from losing everything.
Cascading deletes. mjr00 pushed back on Belanger's recommendation to use foreign keys with cascading deletes: "I hate cascades, for a very simple reason: at most places, the person who set up the cascade is not the person debugging the accidental delete six months later." This is a real tension. Cascading deletes simplify correct cleanup at low volume, but they make unintended data loss silent and hard to trace.
Cost of Postgres for bootstrapping. hmokiguess raised a common frustration: "Postgres is my favorite thing, but I find it is prohibitively costly when bootstrapping something that is lean and frugal. I end up with a mixture of DynamoDB, S3, DuckDB on S3, and SQLite." At roughly $15-50/month for a managed Postgres instance (depending on provider), the cost floor is real for pre-revenue founders. The counterargument: SQLite and DuckDB do not give you the same concurrency model, and DynamoDB shifts the complexity to your application layer.
Stored functions and connection pooling. traceroute66 searched for "function" and found zero results, criticizing the omission. ComputerGuru added practical corrections: use uuidv7 (not uuid v4) for better index performance, and always order locks deterministically by ID ascending to avoid deadlocks. groundzeros2015 questioned whether connection pooling can leak data between requests - a concern that external poolers like pgbouncer handle through session-level pooling, but worth being explicit about.
Matt from Hatchet (mrkaye97) chimed in with a practical addendum: performing joins in application memory has worked well for them in specific cases where the alternative is a single overcomplicated query. This reinforces the broader theme of the guide - Postgres is powerful, but knowing when not to use it for everything is part of the survival skillset.
Newsletter
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools, delivered free every week.
From the archive
Jul 21, 2026 • 10 min read
Jul 21, 2026 • 8 min read
Jul 20, 2026 • 8 min read
Jul 18, 2026 • 6 min read
The guide and the discussion together paint a realistic picture of running Postgres in a startup. The database will not kill you early, but it will find every shortcut you took as you grow. The comment thread surfaced real gaps in the original post - monitoring, backup/restore, stored functions, lock ordering - and the author engaged directly, which is how good operational knowledge gets built.
For teams building on Postgres today, the core takeaway is that the smooth path looks like this:
DevDigest has covered Postgres operational patterns extensively. The Neon Postgres review covers the serverless hosting model that many startups choose today. The pgrust rewrite analysis explores what it means to reimplement Postgres in Rust. And the pgdog sharding proxy post covers what happens when one Postgres instance is no longer enough.
Read next
A Rust reimplementation of PostgreSQL now passes all 46,000+ queries in the Postgres regression suite. Here is what the project actually delivers, what it does not, and why the HN discussion reveals deeper questions about AI-assisted rewrites.
8 min readA deep dive into DuckDB's architecture - columnar storage, vectorized execution, and zero-copy design that lets it compete with million-dollar clusters on a laptop.
8 min readJulia Evans shares hard-won production lessons from running SQLite at scale - from the ANALYZE command that cut query times 100x to backup strategies and write contention gotchas.
6 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Open-source Firebase alternative built on Postgres. Auth, real-time subscriptions, storage, edge functions, and pgvector...
View ToolType-safe SQL builder and ORM for TypeScript. Zero runtime overhead, honest schema migrations, bring-your-own-DB.
View ToolTypeScript ORM with a schema-first workflow. Prisma Client gives full type safety; Prisma Migrate handles migrations. Wo...
View ToolServerless Postgres with branching. Free tier, instant database branches per PR, autoscaling compute, and scale-to-zero....
View ToolWhat MCP servers are, how they work, and how to build your own in 5 minutes.
AI AgentsInteractive timeline showing what's in context at each turn.
Claude CodeManaged scheduling on Anthropic infrastructure with API and GitHub triggers.
Claude Code
In this video, we explore Rich Sutton's 'Bitter Lesson' and its implications for the future of software development, particularly as we approach 2026. We discuss the key principles from Sutton's...

In this video, I walk you through the process of building a micro SaaS application from scratch. We will utilize tools like cursor, V0, and Postgres.new alongside a tech stack that includes...

#FullStackApp #AutonomousApp #Langchain #NextJS #BraveAPI #OpenAIGPT #VercelPostgres #WebDevelopment #CodingTutorial #AIIntegration #AutonomousSystems In this comprehensive tutorial, we delve...

A Rust reimplementation of PostgreSQL now passes all 46,000+ queries in the Postgres regression suite. Here is what the...

Julia Evans shares hard-won production lessons from running SQLite at scale - from the ANALYZE command that cut query ti...

A new distributed inference system pools GPU resources across multiple machines and exposes them through a single OpenAI...

Cloudflare Research introduces Meerkat, a distributed consensus service using QuePaxa that eliminates leader elections a...

Cloudflare announces native support for the x402 HTTP payment protocol, letting developers charge for API calls and web...

A new project proposes a graphical shell layer for SSH that turns remote servers into browsable desktops. The HN discuss...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.