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 EngineeringMore guides
- 01 — BUILD
React Native or Flutter: how to choose for your product's app
React Native vs Flutter for your product's mobile app: team skills, code sharing with web, UI approach, native SDKs, hiring, maintenance and store release.
- 01 — BUILD
How to reduce cloud costs without losing recoverability
A practical approach to cutting cloud infrastructure costs: measure first, right-size, remove idle services, and keep backups and recovery intact.
- 01 — BUILD
Why a stopped AWS database comes back on, and how to retire it properly
Stopped RDS, Aurora and DocumentDB clusters restart on their own after seven days. How to retire an old database safely, and find the other leftover costs.
- 01 — BUILD
Moving a live app to new infrastructure: a cutover checklist
How to move a live application and its data to new infrastructure without losing anything: discovery, rehearsal, verification, cutover and rollback.
- 01 — BUILD
Self-hosted video or a video API: choosing for a telehealth or consultation app
Building video consultations into your app? Compare a hosted video API with self-hosted WebRTC: cost, reliability, networks, privacy and team effort.
- 01 — BUILD
How to design role-based access for operations software
How to design role-based access control for operations software: permissions, deny by default, server-side checks, custom roles, scoping and audit.
- 01 — BUILD
Rolling out access control on a live system: log mode first
How to introduce role-based access control into a live business system without disruption: catalogue routes, map roles, run in log mode, then enforce.
