Decision in brief
Start with PostgreSQL when several application instances need to share relational data and the database must enforce invariants such as unique orders or valid foreign keys. Start with a managed instance if the team cannot run and recover a server yet. An embedded database can be a smaller first choice for a local app that owns its own file.

What PostgreSQL gives an application
PostgreSQL is a client-server relational database. Use transactions to commit related writes together, constraints to protect rules that must hold across clients, and typed columns for values you filter and validate. A JSONB column can hold flexible attributes while core relationships stay in regular tables.
Select the smallest deployment you can recover. Count time for upgrades, monitoring and a tested restore alongside the monthly bill. Inventory extensions and privileges before choosing a managed provider or importing a database from elsewhere.
| Situation | First deployment to test | What should decide |
|---|---|---|
| Shared transactional app with few database operators | Managed PostgreSQL | Required extensions and backup access, restore time and owner of failed migrations |
| Workload needs extensions or host controls the managed service lacks | Self-managed PostgreSQL | Someone can own patching, replication, restoration and incident response |
| Local data owned by a single install | An embedded database such as SQLite | Independent clients and simultaneous writes remain within the tested limit |
| Existing database is already stable | Keep it as the migration baseline | Measure what the switch improves after driver, SQL and operational changes |
Two HN lessons on ownership and schema
In the discussion about self-hosting Postgres, tgtweak described running several engines over many years and singled out upgrades and replication as the hard parts. Their experience makes an upgrade-and-recovery rehearsal a better gate than the ease of creating a server.
In the UUID primary-key thread, socketcluster argued that a result for one operation does not settle a schema decision in another application. Apply that to key choice by testing insert behavior, index size and any need for separately generated identifiers on your own dataset.
Rehearse one PostgreSQL migration
Use a sanitized staging copy with the expected row count and realistic skew. Agree on the latency, cutover and recovery windows before changing anything. A fast query on an empty development database gives a weak baseline.
- Load the schema and fixture into a pinned version using the intended driver. Test duplicate keys, orphan records and a transaction that fails halfway. Validate row counts and sample aggregates after loading.
- Record the plans and runtime of the slowest reads and a representative write mix under realistic concurrency. Use EXPLAIN ANALYZE only on read queries in this trial because it executes the statement.
- Dump and restore into a clean target. Run smoke tests with the application credentials and verify extensions and privileges. Measure time from starting recovery through the first successful application request.
- Approve if integrity checks match, latency fits, and a teammate can meet the recovery window. Stop on unexplained mismatches, a required unsupported extension or an untested rollback.