Topic 77

Managed Postgres, and What It Takes Away

Managed Services

Everything in the operations half of this book can be bought. Amazon RDS, Google Cloud SQL, Azure Database for PostgreSQL Flexible Server, Supabase and Crunchy Bridge all run Postgres and do the backups, the standby, the patching and the dashboards on your behalf, and Neon does the same on a storage layer it wrote itself. For most teams it is plainly a good deal, so the interesting question is the other one: which parts of the preceding thirteen chapters it actually covers.

The line is clean enough to write down. A provider takes over the work of Chapters 12 and 13: scheduled base backups, point-in-time recovery, a standby promoted without anyone being woken, minor-version patching, storage that grows, and metrics you did not instrument. It does not take over row versions and dead tuples, autovacuum thresholds on a 40-million-row table, the planner's estimates and the first-Saturday slowdown, index design, the lock queue behind an ALTER TABLE, or the fact that 400 connections still need a pooler. Everything on the second list stays yours, with less visibility into it than Nadia has today.

The line a provider draws, and which half of this book falls on each side
What the provider takes over
Scheduled base backups and point-in-time recovery, a standby promoted without anyone being woken, minor-version patching, storage that grows, and metrics you did not instrument — Chapters 12 and 13, delivered on the first afternoon.
What stays yours
Row versions and dead tuples, autovacuum thresholds on a 40-million-row table, the planner's estimates and the first-Saturday slowdown, index design, the lock queue behind an ALTER TABLE, and 400 connections that still need a pooler.

What You Actually Buy

Concretely: automated base backups with a retention window and a point-in-time restore that is a console form rather than a procedure somebody has to remember; a standby in another availability zone with automatic promotion and a DNS name that follows it; minor releases applied inside a maintenance window; storage that expands without a resize outage; slow-query and wait-event dashboards; and a support contract with an on-call rotation whose actual job is to answer. For a team without a database specialist that is two chapters delivered on the first afternoon.

It is worth being honest about how good that trade usually is. The work a provider assumes is the kind that is only noticed when it was not done, and it is the work under-resourced teams skip first. An unrestored backup and an unpractised failover are both hypotheses. Buying them as a product moves the problems to people who run them at scale and get paged about them professionally, several times a week, on other people's clusters.

What Is Taken Away

There is no superuser. On RDS the master account is a member of rds_superuser, an elevated but bounded role, and the other providers have their own equivalent; anything that genuinely requires superuser is not available to you. There is no host access either, which removes a whole category of the diagnostics this book has been teaching: no listing the data directory, no tail on the log file, no strace, no offline utilities. Chapter 5's tour of base/16384 is a tour you can no longer take.

Configuration goes through the provider's own parameter store. Many settings are exposed, some are fixed, some are computed from the instance size, and a few of the ones this book treated as decisions are simply not yours to make. That is a real constraint on Chapter 10's baseline rather than an inconvenience. Extensions are a supported list per provider and per major version. New majors arrive months after the community release, which turns the previous topic's upgrade planning into a waiting exercise. And the provider's own limits, meaning connection ceilings and IOPS quotas and a maintenance window they choose, become numbers your design fits rather than numbers you pick.

Three questions to ask a trial instance before the design depends on the answers
SELECT name FROM pg_available_extensions ORDER BY 1;

SELECT name, setting, context FROM pg_settings
 WHERE context = 'postmaster';      -- needs a restart; who schedules it?

SHOW is_superuser;                    -- expect: off

Those three queries take a minute and answer most of what a comparison table leaves out. The first is the definitive extension list for that provider on that version, which is not the marketing page and not last year's. The second finds the parameters that need a restart to change, because on a managed instance a restart is a request rather than a command, and the latency of that request is worth knowing before an incident needs one. The third tells you which of your existing scripts stop working on day one.

Aurora, AlloyDB, and the Forks

Aurora PostgreSQL and AlloyDB are not stock Postgres, and treating them as if they were is the most expensive misunderstanding in this topic. Both replace the storage layer with a distributed service that the compute nodes share; AlloyDB's own documentation describes a disaggregated architecture where compute and storage scale independently, and Aurora is built on the same idea. The SQL surface is compatible; the operational surface is not.

In practice that splits this book cleanly in two. The developer-facing half, meaning the type system, schema design, constraints, the SQL and how a query gets planned, transfers to a fork without a footnote. The internals half transfers as concepts and not as numbers: a row is still a version and dead tuples still accumulate, but checkpoint behaviour, what a replica costs, how far one lags and how long a promotion takes are the fork's own engineering. Anything you were about to predict from Chapters 12 and 13 has to be read from their documentation instead. Pricing diverges as sharply, since these bill consumed storage and I/O rather than a disk you provisioned.

What Does Not Change

The list is long. Postgres still never overwrites a row, so every update leaves debris and every table needs that debris cleaned up. Autovacuum still starts at a fraction of the table's size, which on orders still means millions of dead tuples before the first worker moves. The planner still prices plans from estimates, so the first Saturday of the month still skews the statistics on orders and still flips a hash join into a nested loop that reads three hundred thousand rows to return twenty-one. No provider's monitoring has an opinion about that plan. Which indexes exist is your decision, and so is which ones cost writes without earning a read. A migration still takes a lock and still forms a queue. And a connection still costs a process, which is the reason every provider sells a proxy.

The sharper version is that all of it now happens with fewer instruments. No filesystem to inspect, log retention set by somebody else, some of the previous topic's extensions unavailable, and a diagnosis that arrives as a graph in a console rather than a query you wrote and can modify. A bloat problem on a managed instance is the same bloat problem with less light on it, and that half of the trade appears in no comparison table.

Choosing, With Numbers

The honest comparison is total cost of ownership, and both sides have to be filled in. On one side: the instance, the storage, the proxy, the cross-zone traffic, the support tier, and the higher unit price at scale that everyone eventually notices. On the other: engineer-hours, a pager rotation that needs three people to be humane, both rehearsals, and the risk carried by a failover nobody has practised. A two-person startup should be managed and should stop debating it. A team with a database specialist, a hard cost ceiling at volume, or a dependency on an extension no provider carries has a real case for running it themselves, and that case is tested by whether the restore rehearsal is on a calendar with a date on it.

Before committing, verify five things in writing: the supported extension list for the exact major version, which parameters are settable and which need a provider-scheduled restart, the connection ceiling and whether the proxy is priced separately, how long after a community release a new major arrives, and whether point-in-time recovery restores in place or into a new instance, the last of which changes the shape of the incident and not only its length. All five are answerable in an afternoon on a trial instance.

Cartwheel's Verdict

Cartwheel would be well served by a managed instance: a primary, a read replica for the dashboard, an external pooler, and the four roles this chapter finally separated. The backup and failover work of the last two chapters is worth handing over at Cartwheel's size, the minor upgrades stop being a scheduling argument, and the trust line in pg_hba.conf would never have existed to find. It is the right answer, and it is available today.

None of it would have found why checkout went from 40 ms to 6 seconds on the first Saturday of the month, or how inventory came to occupy 900 MB holding 12,000 rows, or which of two customers got the last box of strawberries. A provider will run the server. It will not read the plan, choose the index, size the vacuum, decide what a transaction is entitled to see, or notice that a sequence has consumed 63% of its ceiling. That is the half of the job that stayed with Nadia through every chapter of this book, and it is the half that is still yours after everything else has been handed to somebody else's on-call rotation. None of it has to be guesswork any more, which is the only thing fourteen chapters can honestly buy you.

Self-managed vs managed stock vs an Aurora-style fork

Self-managed gives full control, every extension, any parameter, the filesystem in front of you, and Chapters 12 and 13 as permanent ongoing work carried by named people with a pager.

Managed stock Postgres is the same engine with the operations outsourced and the surface constrained: no superuser, no host, a supported extension list, and new majors arriving late. Most teams should be here.

Aurora or AlloyDB bring a re-engineered storage layer with different failover and replica characteristics, wire-compatible SQL, and operational behaviour that this book's internals chapters predict only in outline. The developer half applies identically to all three, which is why it came first.

Common Mistakes
  • Assuming vacuum, bloat, plan regressions and lock queues transferred with the contract — they are still yours, with no filesystem to look at and a log retention window you did not choose.
  • Designing around an extension the provider does not carry, and discovering it at deployment rather than in the first hour of evaluation.
  • Reasoning about Aurora or AlloyDB checkpoints, replica lag and failover using stock Postgres behaviour — the storage layer is different, and so are the numbers.
  • Skipping the restore rehearsal because backups are automatic — the provider guarantees the backup exists, not that your team can perform a point-in-time restore under pressure.
  • Comparing the instance price against a virtual machine and stopping there — the price is replacing engineer-hours, a pager rotation and rehearsals, and those belong on the other side of the sum.
  • Treating a connection ceiling or an IOPS quota as a soft limit — they are hard numbers your design has to fit, and finding out during a Saturday spike is the expensive way.
Best Practices
  • Decide from a written comparison of cost, required extensions, control needs and the team's real operational capacity, rather than from preference or habit.
  • Query pg_available_extensions and the restart-only parameters on a trial instance before any design depends on either.
  • Rehearse a point-in-time restore and a failover on the managed service too, using its own tooling and timing both.
  • Put a pooler in front of a managed instance for the same reason as anywhere else, and check whether the provider's proxy is included or billed separately.
  • Read the fork's own documentation for anything about storage, checkpoints, replicas or failover, and keep this book's internals for the engine underneath your queries.
Comparable toolsAmazon RDS for PostgreSQL and Aurora PostgreSQLGoogle Cloud SQL and AlloyDBAzure Database for PostgreSQL Flexible ServerSupabase, Crunchy Bridge smaller vendors on stock PostgresCloudNativePG the Kubernetes middle ground, still your cluster

Knowledge Check

Which chapter of this book does a managed provider genuinely take over for you?

  • Vacuum and bloat, since autovacuum is tuned by the provider for you
  • Backup and recovery, along with the standby and its promotion
  • Index design, because the platform recommends and creates them
  • The planner's behaviour, because plans are managed by the service

Why is treating Aurora or AlloyDB as stock Postgres an expensive assumption?

  • Their SQL dialect differs, so ordinary queries need to be rewritten
  • The storage layer is replaced, so checkpoints and failover differ
  • They abandon multiversion concurrency, so dead tuples never appear
  • They are only available as managed services rather than as software

Backups on a managed service are automatic. Why does the restore rehearsal still belong on the calendar?

  • The provider does not verify that its own backups can be read back
  • The guarantee covers the backup existing, not your team performing one
  • Automated backups expire unless a restore is performed periodically
  • Restoring through a provider's own console is harder than doing it by hand

What should you check on a trial managed instance before a design depends on it?

  • Raw sequential scan throughput measured against a comparable virtual machine
  • The available extensions and which parameters need a scheduled restart
  • The page size in use, since providers compile the server themselves
  • The write-ahead log segment size, which varies between providers

A managed instance has no host access. Which of this book's habits does that remove?

  • Reading pg_stat_activity to find sessions that are idle in transaction
  • Inspecting the data directory and reading the server log with tail
  • Running EXPLAIN with buffer counts to see what a query actually read
  • Building an index concurrently so a live table keeps taking writes

You got correct