Skip to content
Guide · Cloud database basics

Database Hosting: How to Choose the Right Option (Complete Guide)

Database hosting means choosing where your database runs and who operates it. This guide gives a decision framework for the four main options (a database bundled with shared web hosting, a database you install on a VPS or cloud VM, a managed database service, and a serverless database), explains the trade-offs in control, effort, cost and resilience, and points you to the right next page by engine and by cloud.

Facts checked 8 October 2026 against the providers' official documentation and pricing pages. Next review due January 2027. Cloud services, regions and prices change often; confirm on the provider's site before you buy.
Short answer
  • 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.
How we know: Research-based: service descriptions, responsibilities and the listed bundle prices were checked against AWS (Amazon RDS documentation, Amazon Lightsail pricing), Microsoft Learn, Google Cloud, DigitalOcean and Neon pages on 8 October 2026. CodeWithSQL has not run these services for this guide, so no performance claims are made.

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.

Database hosting options: shared hosting, VPS, managed and serverless
Shared hosting databaseVPS or cloud VM (self-managed)Managed database serviceServerless database
Typical enginesMySQL or MariaDB bundled with a web hosting planAnything you can installPostgreSQL, MySQL, MariaDB, SQL Server, Oracle and more, depending on providerMostly PostgreSQL, MySQL-compatible and SQLite-style engines, plus NoSQL services
Who operates itThe host, with little control for youYouThe provider; you configureThe provider; capacity adjusts itself
Backups and recoveryWhatever the plan includesYou build and test themAutomated backups and point-in-time restore on most servicesAutomated; restore windows vary by plan
High availabilityRarelyYou build it (replication, failover)Optional standby in another zoneOften built into the storage layer
BillingPart of the hosting feeVM per hour or month, plus disksInstance hours plus storage, backups, standby, transferCompute used plus storage
Best forSmall websites and CMS installsFull control, unusual versions or extensions, tight budgets with time to spareProduction applications and teams without a DBADevelopment databases, side projects, spiky or intermittent traffic
Main riskResource limits and noisy neighboursOperational mistakes, untested backupsCost creep from add-onsResume 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:

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.

Entry-level fixed monthly plans: VPS vs managed database (list prices, 8 October 2026)
PlanTypeResources (as listed)Price per month
Amazon Lightsail Linux bundleVPS (you install and run the database)1 GB memory, 2 vCPUs, 40 GB SSD, 2 TB transfer7 USD
Amazon Lightsail managed database, standard planManaged database1 GB memory, 1 core, 40 GB SSD, 100 GB transfer15 USD
Amazon Lightsail managed database, high availability planManaged database with redundancySame size as above, with extra instances for failover30 USD
DigitalOcean Managed PostgreSQL, 1 GiB nodeManaged database1 GiB memory, 1 vCPU15.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

Checked 8 October 2026.

How we research cloud database guides: our editorial method. CodeWithSQL earns nothing from the providers mentioned.

Choosing where to run your database?

Start with the section overview, or compare providers side by side.