What the provider takes over
Running PostgreSQL yourself means owning updates, storage, backups and recovery, as well as the application queries. A managed service takes over some of that work, with the exact responsibilities depending on the service and plan.
You still need to understand performance, access and recovery requirements. Compare the two options by looking at who will handle each task and what support your team can provide.
What a managed service takes off your plate
A managed database is PostgreSQL run by your cloud provider or a database company. You get a connection string and a console. Underneath, they handle the work that is tedious, easy to get wrong and usually discovered at the worst moment.
Backups
Automated daily snapshots plus continuous archiving of the write-ahead log, which lets you restore to a specific minute rather than to last night. Setting this up by hand is doable. Keeping it working for years, with someone noticing when it silently stops, is the hard part.
Failover
A standby copy in another zone that takes over if the primary fails, usually within a minute or two. Building reliable automatic failover yourself is a serious project, and a badly built one causes more outages than it prevents.
Patching and upgrades
Security patches applied in a maintenance window you choose. Major version upgrades become a guided process instead of a weekend of reading release notes.
Monitoring basics
Metrics for CPU, memory, storage, connections and replication lag, plus alerts when storage runs low. The full-disk Saturday becomes an email on Wednesday.
For a team without a dedicated database person, these four items are most of the operational risk. Handing them over is worth a lot.
What it does not do
This is where expectations go wrong.
Your queries are still yours
A managed database runs exactly the queries your application sends. A missing index, an N+1 query pattern or a report that scans a whole table is just as slow on managed hardware. Bigger instances can hide the problem for a while, at a price. The fix is still in your code and schema. Our article on scaling a Laravel monolith covers the usual suspects.
Schema design and migrations
Long-running migrations that lock big tables, columns with the wrong type, missing constraints: none of this is the provider's concern. You still need a careful migration practice.
Cost growth
Managed databases are priced per instance size, storage and often per input and output operation. As data grows, the bill grows, and the jump between instance sizes is not always gentle. It pays to look at the pricing model before you are locked into it.
Limits on control
Providers restrict what you can change. Some extensions are unavailable, some configuration settings are fixed, superuser access is usually not offered, and you cannot install your own tools on the server. For most applications this never matters. For a few it is a dealbreaker.
When self-hosting makes sense
Running PostgreSQL yourself, on a virtual machine or a dedicated server, is a reasonable choice in a handful of situations:
- You need extensions or tuning a provider does not allow. Specialized search, time-series or geospatial setups sometimes fall here.
- Data placement rules are strict. A regulator or customer contract requires the data to live in a specific facility or country where managed options are thin.
- Load is steady and large. Predictable, heavy usage on owned or rented hardware can cost noticeably less than the equivalent managed instance, provided you count the engineering time honestly.
- You already have the skills. A team with someone who has run PostgreSQL in production, and a second person who can cover, is in a different position from a team learning on the job.
If none of these apply, the time saved by managed usually beats the money saved by self-hosting. If you are still deciding where the rest of your stack should run, our comparison of cloud, VPS and dedicated servers is a useful companion.
An operational checklist for either path
The same list applies whether a provider runs the database or you do. With managed, some items are ticked for you; check which ones rather than assuming.
- Backups run automatically and are monitored. Someone gets alerted if a backup fails.
- Restores are tested. At least every few months, restore a backup to a separate instance and check that the application works against it. Time how long it takes, because that is your real recovery time.
- Point-in-time recovery is enabled, so an accidental delete at 14:05 can be undone to 14:04.
- Storage alerts fire early, well before the disk is full.
- Slow queries are logged and reviewed on a regular schedule, not only during incidents.
- Connections are pooled, because PostgreSQL handles a few hundred connections far better than a few thousand.
- Access is limited. The database is not reachable from the public internet, and application credentials cannot drop tables.
- Upgrades are planned. Know which major version you run and when support for it ends.
Signs you picked the wrong one
Neither choice is permanent, and both have warning signs worth watching.
Signs managed is not working for you
- The monthly bill grows faster than your traffic, mostly from storage operations or instance jumps you could not plan for.
- You keep hitting a missing extension or a locked setting, and the workarounds add complexity to the application.
- Support tickets are your only window into problems at the database level, and answers take days.
Signs self-hosting is not working for you
- Backups exist, but nobody has restored one in the last six months.
- Upgrades keep getting postponed, and you are a major version or two behind.
- Database incidents depend on one person being awake and reachable.
- Engineers spend more hours a month on the database server than the price difference with a managed instance would cover.
The second list is the more common one. Teams tend to underestimate the slow, steady cost of keeping a database healthy, because most of that cost only shows up during an incident. If two or more items from either list sound familiar, it is worth costing out the other option properly rather than living with the friction.
Migrating between them safely
Moves happen in both directions: from a self-hosted server to managed after an incident, or from managed to self-hosted when the bill grows. The safe pattern is the same.
Rehearse first
Restore a copy of production into the target and run your application against it in a staging environment. Check extensions, character encodings, collations and any configuration you rely on. Surprises found here cost an afternoon. Found during the cut-over, they cost a night.
Keep downtime short with replication
For small databases, a dump and restore during a short maintenance window is fine. For larger ones, set up logical replication from the old database to the new one, let it catch up, then switch the application over. The window shrinks to the time it takes to stop writes, confirm the replica is current and change the connection string.
Verify, then switch
Compare row counts and a sample of checksums on important tables. Switch reads first if you can, then writes. Keep the old database running and untouched for a few days, so you can roll back if something only shows up under real traffic.
Check your database responsibilities
If your database runs next to your application on a single server with no tested restore, fix that before anything else. Either move to a managed service or, if you have reasons to self-host, put backups, monitoring and a restore drill in place this month.
If you are already on managed and the bill or the slow queries are the problem, look at the queries before the instance size. Both decisions are the kind of infrastructure work our cloud and DevOps team handles.


