Skip to main content
ProsperousTech
01 — BUILD: Product Engineering

Managed or self-hosted database: a per-workload decision

Few infrastructure choices affect cost, reliability and team workload as much as where the database runs. Managed database services handle patching, failover and backups for you. Self-hosting on your own servers can cost far less, but every one of those jobs becomes yours.

There is no single right answer. The same team can sensibly choose a managed service for one system and self-host for another. This guide sets out the questions we use to decide, and what must be in place before self-hosting is a responsible choice.

1. What a managed service actually gives you

A managed database is more than a server with a database installed. You are paying for automated backups and point-in-time recovery, patching and version upgrades, failover to another zone, monitoring, and a provider that is on call when the hardware fails.

That is real value, and for many teams it is worth the price. The question is whether your workload needs all of it, and whether the price reflects the size of the workload or the size of the default configuration.

2. Compare the full cost, not the hourly price

Self-hosting looks cheaper on the bill, and often is. But the comparison must include the work that moves to your team: setting up replication, writing and testing backups, applying security patches, watching disk growth and responding when something breaks at night.

  • Infrastructure cost of each option at your real size, not the default size
  • Engineering time to build and maintain backups, monitoring and upgrades
  • The cost of downtime for this particular system
  • Data transfer and storage charges, which differ between options

3. When managed usually wins

Managed services are usually the right choice when the team has no one who wants to own database operations, when downtime is very expensive, or when the system needs automatic failover across zones from day one.

They also make sense early in a product's life, when the data is small, the bill is modest and the team's attention is better spent on the product. A small managed tier on a shared cluster can be both cheap and safe.

  • No one on the team can own database operations
  • Automatic multi-zone failover is a firm requirement
  • The data is small and a low managed tier fits the budget
  • Compliance or customer requirements favour a managed provider

4. When self-hosting usually wins

Self-hosting tends to win when a managed cluster is heavily over-provisioned for the workload, when its pricing scales badly with your data or usage pattern, or when the team already operates infrastructure with confidence.

It is also worth considering when the managed option is a compatible imitation of a database rather than the database itself. Running the real engine can remove compatibility workarounds as well as cost.

  • Measured utilisation is low compared with what the managed cluster costs
  • The team has, or is willing to build, database operations skills
  • The availability requirement can be met without automatic multi-zone failover
  • The managed option limits features or versions you need

5. What you must add if you self-host

Self-hosting is responsible only if you replace what the managed service was doing. Skipping these steps is where the savings turn into data loss.

  • Run the database as a replica set or cluster, even with a single node, so you can add members later
  • Use a fixed-performance instance, not a burstable one, for steady database load
  • Take frequent backups to storage that can't be deleted or altered for a set period
  • Restore backups automatically on a schedule and check the counts match
  • Monitor disk space, memory, replication state, slow queries and backup age
  • Keep the database on a private network with no route from development environments
  • Plan and rehearse version upgrades rather than leaving them indefinitely

6. Write down the trade-off

Whichever you choose, record what you gave up. A self-hosted single-node database has no automatic failover: say so, and write down how long a restore takes and how you would add a second node. A managed choice may cost more than the workload needs: say so too, and agree the signal that would make you revisit it.

A written trade-off turns a cost decision into an engineering decision that the next person can understand, challenge and change when the situation does.

Common questions

Is a self-hosted database less reliable than a managed one?

It doesn't have to be, but reliability becomes your responsibility. With replication, tested backups and monitoring in place, a self-hosted database can be dependable. Without them, it is a risk.

Can we start managed and move to self-hosted later?

Yes, and this is often sensible. Starting managed keeps early effort low. Moving later needs a careful migration with verified data parity and a rollback plan.

Do we still need backups if we use a managed service?

Managed backups cover many failures, but check their retention and test restoring from them. For important data, an independent copy that can't be deleted adds protection.

Related service

Build products customers can rely on.

Product Engineering 

More guides

Have a project in mind?

Tell us what you need to build.

Share where the product is today and where it needs to go. We'll suggest a sensible first step.