Skip to content
Article

What Is DBaaS (Database as a Service)? Managed Databases

What the provider and the customer each own in DBaaS, backups and point-in-time restore, replication, scaling, the VM alternative and the trade-offs.

Oğuzhan Gerçek··10 min read
What Is DBaaS (Database as a Service)? Managed Databases

Short answer: DBaaS (database as a service) is a cloud service in which a provider runs the database for you: you create it from a console or an API and never deal with the server underneath. Amazon RDS, Azure SQL Database and Google Cloud SQL are typical examples. Hardware, the operating system, patching, automated backups and failover move to the provider, while administering the databases, query tuning, user permissions and the data itself stay with the customer. In return, access to the server and some settings are restricted and dependence on the provider grows, and you need to check separately which region your backups live in.

What is DBaaS?

In AWS's definition, Amazon RDS is a web service that makes it easier to set up, operate and scale a relational database in the cloud, and it manages common database administration tasks. According to Microsoft, Azure SQL Database is a fully managed PaaS database engine that handles most database management functions, such as upgrading, patching, backups and monitoring, without user involvement. According to Google, Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL and SQL Server. The model exists for NoSQL too: according to AWS, with DynamoDB you don't provision any servers or install and patch any software (see our NoSQL article).

The three service models in NIST's SP 800-145 definition are SaaS, PaaS and IaaS; DBaaS is not listed separately. It can be treated as PaaS, as Microsoft does with Azure SQL Database: in NIST's definition, the PaaS consumer does not manage or control the underlying network, servers, operating systems or storage. We explain how the models differ in our IaaS article and what a database management system is in our DBMS article.

Shared responsibility: what does the provider do, and what stays with you?

According to AWS's comparison, with RDS everything from hardware and the operating system to database software patching, backups and high availability is handled by AWS, while application optimization stays with the customer (see our DBA article). Google's list for Cloud SQL spells out the customer's share in more detail:

  • Databases and performance: Creating and administering the databases and any user-created code, and tuning performance for the workload. AWS likewise makes query tuning the customer's job.
  • Setup decisions: Choosing the version, location and size, and configuring high availability and disaster recovery. Google provides high availability only on instances that are configured for it.
  • Data and access: According to Microsoft, data classification, encryption decisions, accounts and access policies stay with the customer in every model, and so do application configuration and code security (see our SQL injection article). AWS strongly recommends not using the master user created at setup directly in applications.
  • Network: AWS recommends running the database inside a VPC. When a database is first created, its firewall blocks all access except what the rules of its security group allow.

Backups and point-in-time recovery (PITR)

According to AWS, RDS backs up the entire DB instance, not individual databases, with a storage volume snapshot taken during the backup window. The retention period can be set between 0 and 35 days: the default is seven days for an instance created in the console and one day for one created through the API or CLI, and 0 disables automated backups. Transaction logs are uploaded to S3 every five minutes, and you can restore to any point within the retention period. In Azure SQL Database, retention runs from 1 to 35 days with a default of seven, and long-term retention extends to 10 years.

A point-in-time restore in RDS does not touch the source instance; it creates a new DB instance. That instance starts with the default parameter and option groups, and the application has to be pointed at it. If you delete an instance without choosing to retain automated backups, they are deleted along with it. Only a restore test proves that a backup works. We cover backup types in our backup article, backup as a service in our BaaS article and how to set a data-loss target in our RPO and RTO guide.

High availability and read replicas

  • Multi-AZ: An RDS Multi-AZ DB instance deployment keeps a synchronously updated standby replica in a different Availability Zone, and that standby does not serve read traffic. Failover is automatic and, according to AWS, typically takes 60–120 seconds; because the DNS record changes, the application has to re-establish its connections.
  • Read replicas: In RDS, changes are copied to a replica asynchronously. The replica accepts only read-only connections, takes read load off the primary and can be promoted to a standalone database in a disaster.

We explain synchronous and asynchronous replication in our replication article and planning for the loss of a whole region in our DRaaS article.

Scaling

Each of the three resources scales by its own rules:

  • Compute: In RDS, changing the DB instance class causes downtime; according to AWS, Multi-AZ helps minimize it. In Azure SQL Database, a single database can be scaled up or down without downtime, but only manually; in the serverless tier, compute scales automatically with the workload and is billed per second.
  • Storage: With RDS storage autoscaling turned on, storage grows when free space stays at or below 10% for at least five minutes. It never goes the other way: allocated storage can't be reduced later.
  • Read capacity: Added by creating read replicas; writes still go to the primary.

DBaaS vs. a database on a VM or on premises

According to AWS, on premises you assume full responsibility for the server, the operating system and the database software. Run the database on a virtual machine (EC2) and the hardware moves to the provider, but a mistake while manually updating the operating system or database software can still cause application downtime.

What a VM buys you is control: in NIST's IaaS definition, the consumer controls the operating system and can deploy and run arbitrary software. According to SP 800-146, workload portability is also generally more achievable in IaaS. The DBaaS model can be built on premises as well: OpenStack's Trove project describes itself as Database as a Service for OpenStack. We describe the managed platform model on our managed platform services page.

How does the DBA's job change?

DBaaS reduces installation and patching work, but it does not eliminate the DBA's job:

  • Version calendar: RDS can apply minor version upgrades automatically in the maintenance window. Major version upgrades, which can introduce changes that are not compatible with existing applications, are yours to start, and AWS recommends testing them on a test instance first. When standard support ends, RDS Extended Support, which is available for MySQL and PostgreSQL, buys up to 3 more years at additional cost, after which RDS upgrades the major version itself.
  • Maintenance: Some maintenance items take the instance offline for a short time. If you don't pick the weekly 30-minute window yourself, RDS assigns one on a randomly selected day.
  • Performance: In Azure SQL Database's automatic tuning, the option that forces the last known good query plan instead of a regressed one is on by default, while creating and dropping indexes are off.

We cover day-to-day operations in our database platform and operations service, and a platform layer on which teams can provision their own databases in our database platform engineering service.

Trade-offs: lock-in, cost, configuration limits and data location

Frequently asked questions

What does DBaaS mean? It stands for database as a service. Installation, patching, backups and high availability are the provider's job; the user creates the database and connects the application to it.

Is a managed database the same thing as DBaaS? The two terms are usually used interchangeably. AWS, Microsoft and Google describe these services as managed or fully managed databases.

What are some examples of DBaaS? Amazon RDS, Azure SQL Database and Google Cloud SQL are well-known relational examples, and Amazon DynamoDB is a NoSQL one.

Can a DBaaS platform run in our own data center? Yes, on top of an on-premises cloud platform. OpenStack's Trove project aims to automate deployment, configuration, patching, backups, restores and monitoring, but running the platform itself then falls to the organization.

Sources