- Shared hosting databases suit small websites only; a VPS gives full control but makes backups, patching and recovery your job.
- A managed database service is the default for production applications: the provider automates backups, patching and failover, and you pay for that work in the price.
- Serverless databases fit idle or spiky workloads because compute can pause, at the cost of a resume delay and usage-based bills.
- Decide in this order: engine, where the application runs, workload shape, recovery needs, then budget.
What database hosting means
Database hosting is the infrastructure and service that keeps a database running and reachable for your application. Every database is hosted somewhere: on a laptop during development, on a server you own, on a rented virtual machine, or inside a provider's managed service. The choice decides who installs and patches the engine, who takes and tests backups, what happens when a server fails, and how you are billed.
Cloud database hosting has largely replaced self-hosting for new applications, but not every workload needs a full managed service. A personal blog, an internal tool and a customer-facing SaaS product have different needs, and the cheapest suitable option differs for each.
The four database hosting options compared
The table compares the four options on the points that usually decide the choice. Prices for comparable entry plans are in the dated pricing section further down.
| Shared hosting database | VPS or cloud VM (self-managed) | Managed database service | Serverless database | |
|---|---|---|---|---|
| Typical engines | MySQL or MariaDB bundled with a web hosting plan | Anything you can install | PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and more, depending on provider | Mostly PostgreSQL, MySQL-compatible and SQLite-style engines, plus NoSQL services |
| Who operates it | The host, with little control for you | You | The provider; you configure | The provider; capacity adjusts itself |
| Backups and recovery | Whatever the plan includes | You build and test them | Automated backups and point-in-time restore on most services | Automated; restore windows vary by plan |
| High availability | Rarely | You build it (replication, failover) | Optional standby in another zone | Often built into the storage layer |
| Billing | Part of the hosting fee | VM per hour or month, plus disks | Instance hours plus storage, backups, standby, transfer | Compute used plus storage |
| Best for | Small websites and CMS installs | Full control, unusual versions or extensions, tight budgets with time to spare | Production applications and teams without a DBA | Development databases, side projects, spiky or intermittent traffic |
| Main risk | Resource limits and noisy neighbours | Operational mistakes, untested backups | Cost creep from add-ons | Resume delay after idle; less predictable bills |
A decision framework for choosing database hosting
Answer these questions in order. Each answer narrows the options before you compare prices.
1. Which engine do you need?
The engine comes first because it limits the providers. MySQL and PostgreSQL are offered almost everywhere; SQL Server and Oracle are offered by the hyperscale clouds (Amazon RDS supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and Db2; Google Cloud SQL supports MySQL, PostgreSQL and SQL Server). If you are still choosing an engine, read MySQL vs PostgreSQL first.
2. Where does the application run?
Host the database in the same cloud and region as the application whenever you can. It keeps latency low, avoids data transfer charges between providers, and lets you use private networking instead of exposing the database to the internet.
3. What does the workload look like?
Steady traffic through the day suits a provisioned instance billed by the hour. Long idle periods (development, staging, internal tools used in office hours, side projects) suit a serverless database that pauses compute. Neon, for example, documents that an inactive database scales to zero after 5 minutes, so you pay for active time instead of 24/7 compute. Heavy analytical queries over large tables suit a data warehouse rather than an application database.
4. How much downtime and data loss can you accept?
This is the question most often skipped. If losing a day of data or being down for hours is unacceptable, you need automated backups with point-in-time restore and, for critical systems, a standby in another availability zone. Managed services make both a configuration choice. On a VPS you must build, monitor and regularly restore-test them yourself. AWS's RDS documentation lists scaling, high availability, backups and patching as customer tasks on a self-managed VM and AWS tasks on RDS.
5. What is the budget, including your time?
Compare total monthly cost (compute, storage, backups, standby, transfer) and add the time you would spend operating a self-managed server. For a small team, the managed premium is usually cheaper than the hours spent on backups and upgrades. Dated list prices for the big three are in the cloud database pricing comparison.
When each database hosting service fits
Shared hosting with a database
Web hosting plans often include one or more MySQL or MariaDB databases managed through a control panel. This is fine for a WordPress site or a small CMS. It is a poor fit for an application with its own users and data: you share the server with other customers, cannot tune the engine, and often cannot reach the database from outside the host.
VPS or cloud VM, self-managed
Renting a virtual server and installing the database yourself gives the most control for the least money in infrastructure terms. It fits when you need an unusual engine version or extension, operating-system access, or when the database must run next to other software on the same machine. The cost is operational: AWS's own comparison notes that on a VM you remain responsible for the database software, the operating system and backups. Do not choose this option unless someone on the team will own backups and patching.
Managed database service
For production applications this is the default. Amazon RDS, Azure SQL Database and Azure Database for PostgreSQL or MySQL, Google Cloud SQL, DigitalOcean Managed Databases and Aiven all automate backups and patching and offer standby options. Some providers sell simpler bundles: Amazon Lightsail's managed databases come as fixed monthly plans, with a high availability plan that adds extra instances for redundancy and failover. Our managed databases guide explains what is handled for you, and DBaaS explained covers the service model and buying criteria.
Serverless database
Serverless options (Aurora Serverless, Azure SQL Database serverless, Neon, Cloudflare D1, DynamoDB on-demand) remove instance sizing and can pause compute when idle. They fit development and preview environments, low-traffic production apps and unpredictable spikes. Check the documented resume behaviour before you rely on one for latency-sensitive requests; see serverless databases explained.
Database hosting by engine and by cloud
Once you know the option you want, choose by engine or by cloud:
- By engine: PostgreSQL hosting and MySQL hosting each have their own guides in this section, as do MongoDB hosting and managed SQL Server. For engine choices, see MySQL vs PostgreSQL and SQL Server vs PostgreSQL.
- By cloud: Amazon RDS, Azure SQL Database and Google Cloud SQL each have an explainer here. For head-to-head detail, read AWS RDS vs Azure SQL Database and AWS RDS vs Google Cloud SQL.
- By provider: best database hosting providers is a criteria-based shortlist, and free database hosting compares free tiers and their limits.
Pricing
Prices from the provider's official pricing pages, checked 8 October 2026, region Default listing on the Amazon Lightsail and DigitalOcean pricing pages, in USD, excluding tax. List prices only; discounts, commitments and your actual usage change the bill.
To show the price gap between a self-managed VPS and a managed database of similar size, the table uses fixed monthly plans, which make the comparison simple. These are entry-level plans; the hyperscale managed services are compared on the pricing comparison page.
| Plan | Type | Resources (as listed) | Price per month |
|---|---|---|---|
| Amazon Lightsail Linux bundle | VPS (you install and run the database) | 1 GB memory, 2 vCPUs, 40 GB SSD, 2 TB transfer | 7 USD |
| Amazon Lightsail managed database, standard plan | Managed database | 1 GB memory, 1 core, 40 GB SSD, 100 GB transfer | 15 USD |
| Amazon Lightsail managed database, high availability plan | Managed database with redundancy | Same size as above, with extra instances for failover | 30 USD |
| DigitalOcean Managed PostgreSQL, 1 GiB node | Managed database | 1 GiB memory, 1 vCPU | 15.15 USD |
Frequently asked questions
What are database hosting services?
They are services that run a database for you or give you a server to run it on: database space on shared web hosting, virtual servers where you install the database yourself, managed database services such as Amazon RDS or Google Cloud SQL, and serverless databases such as Neon or Aurora Serverless.
What is cloud database hosting?
It is hosting a database on a cloud provider's infrastructure, either on a virtual machine you manage or, more commonly, as a managed or serverless database service where the provider handles operations.
Is a VPS or a managed database better for hosting a database?
A VPS is cheaper on paper and gives full control, but you must handle backups, patching, monitoring and failover. A managed database costs more per resource and removes most of that work. For production data without a dedicated administrator, managed is usually the safer choice.
What are SQL database hosting services?
Services that host relational engines such as MySQL, PostgreSQL, MariaDB and SQL Server. Managed options include Amazon RDS, Azure SQL Database and Azure Database for PostgreSQL or MySQL, Google Cloud SQL, DigitalOcean Managed Databases and Aiven.
Can I host a database on shared hosting for an application?
For a small website, yes. For an application with real users, shared hosting limits resources, tuning and remote access, so a small managed database or VPS is a better base.
Sources
- AWS docs: What is Amazon RDS?
- Amazon RDS product page
- Amazon Lightsail pricing
- Google Cloud: Cloud SQL overview
- Microsoft Learn: What is Azure SQL Database?
- DigitalOcean Managed Databases pricing
- DigitalOcean docs: Managed Databases
- Neon docs: Scale to zero
- Amazon Aurora Serverless
- Neon pricing
Checked 8 October 2026.
How we research cloud database guides: our editorial method. CodeWithSQL earns nothing from the providers mentioned.