Back

Go ahead, self-host Postgres

1 day ago pierce.dev

Story Summary Story

Last updated: 1 day ago

The common narrative that self-hosting is inherently dangerous compared to cloud managed services is being challenged. Many managed offerings use standard open-source database engines with added operational tooling, and abstraction can hinder performance tuning.

The shift toward outsourcing infrastructure management accelerated around 2015, but rising cloud pricing makes self-hosting more financially attractive. Successful self-hosting requires managing configuration aspects like memory allocation (shared_buffers, effective_cache_size), connection pooling (using tools like PgBouncer), storage tuning for modern NVMe SSDs, and Write-Ahead Logging (WAL) settings.

Operational tasks for a stable self-hosted setup are manageable, involving only a small amount of time weekly or monthly for updates and reviews. While self-hosting means owning incident response, cloud outages still require user intervention. Self-hosting is generally recommended unless a team is just starting out, or is so massive that hiring dedicated database engineers outweighs outsourcing costs, or specific regulatory compliance dictates a managed platform.

Comments Summary Comments (373)