Sub topic 1
What RDS does for you and what it does not
Amazon Relational Database Service (RDS) runs a relational database engine on infrastructure that AWS operates. You get a database endpoint you can connect to, and AWS handles much of the work underneath it. That work does not cover everything. This chapter draws the line between the two sides, because many RDS incidents come from assuming AWS handles something it does not.
Prerequisites
This chapter assumes you already know the following:
- Basic relational database concepts: tables, SQL, and client connections.
- How AWS accounts, IAM users or roles, and the AWS CLI work.
- What a VPC, a subnet, and a security group are.
Later chapters in this tutorial cover the individual features in detail. This chapter gives you the model that organizes them.
What "managed" means in RDS
When you run a database yourself on an Amazon EC2 instance, you install the engine, patch the operating system, configure backups, and build failover. With RDS, AWS takes over most of that infrastructure and operating-system work. You still choose the engine, size the instance, design the schema, and write the queries.
RDS gives you a DB instance. A DB instance is an isolated database environment running one engine, with its own compute, storage, and network endpoint. You cannot log in to the underlying operating system. The one exception is RDS Custom, a separate offering for specific engines that is not covered in this tutorial.
The restriction is deliberate. Because AWS controls the host, it can automate backups, patching, and replacement of failed hardware safely. The cost is that you cannot install arbitrary software on the host or use superuser privileges that would let you change the host. Instead, RDS gives you a restricted administrative role. In PostgreSQL this role is rds_superuser, and in MySQL the master user receives a broad but limited set of privileges.
What AWS handles
AWS is responsible for the underlying service and infrastructure, which AWS calls security and operations "of" the cloud. For RDS this covers the following.
- Hardware and facilities. Physical servers, storage, networking, and data centers.
- Host operating system. Installing and patching the OS that the engine runs on.
- Engine installation. Deploying the database software and, when you allow it, applying minor version updates.
- Automated backups. Daily snapshots of the storage volume plus transaction logs, which let you restore to a point in time within your retention period.
- Failure detection and failover. In a Multi-AZ deployment, RDS detects a failed primary and promotes a standby in another Availability Zone.
- Provisioning and scaling operations. Creating instances, changing instance class, and increasing storage through API calls.
- Monitoring hooks. Publishing metrics to Amazon CloudWatch and supporting Performance Insights.
- Encryption machinery. Encrypting storage with AWS Key Management Service (KMS) keys when you enable it, and offering TLS endpoints.
What stays your responsibility
AWS describes the customer side as responsibility "in" the cloud. For RDS, these are the tasks people most often assume are automatic.
- Network exposure. You choose the VPC, the DB subnet group, the security group rules, and whether the instance is publicly accessible. A permissive security group exposes your database no matter how well AWS patches the host.
- Authentication and authorization. You create database users, grant privileges, rotate credentials, and decide whether to use IAM database authentication.
- Enabling encryption. Storage encryption must be chosen when you create the instance. You must also configure clients to use TLS and to verify the server certificate.
- Schema, queries, and indexes. RDS will not fix a slow query or a missing index. A poorly written query can saturate a large instance.
- Capacity planning. You select the instance class and storage type, and you decide when to resize.
- Backup and recovery decisions. You set the retention period, take manual snapshots, and test restores. Setting retention to 0 turns automated backups off.
- High-availability choices. Multi-AZ is an option you enable. A single-AZ instance has no standby.
- Upgrade planning. AWS can apply minor versions automatically, but major version upgrades are your decision. You must also move off engine versions that reach end of support.
- Parameter tuning. Engine settings live in parameter groups that you create and assign.
- Cost and cleanup. You pay for running instances, storage, backups beyond the free allocation, and snapshots until you delete them.
The shared responsibility model for RDS
The split above follows the AWS shared responsibility model. The diagram shows the boundary for a typical RDS deployment.
Some features sit on both sides at once. AWS provides the backup mechanism, but you decide the retention and verify that a restore works. AWS provides failover, but you must enable Multi-AZ and make your application reconnect after the endpoint's DNS record changes.
Worked example: who is responsible for each failure?
Consider five incidents and decide which side owns the fix.
| Incident | Owner | Why |
|---|---|---|
| The host hardware under the instance fails | AWS | Hardware replacement is part of the service. With Multi-AZ, failover also happens automatically. |
| The database is reachable from the internet and gets brute-forced | You | Public accessibility and security group rules are your settings. |
| A query without an index causes high CPU for hours | You | RDS runs the query you send it. |
| You deleted an instance and never took a final snapshot | You | Automated backups are removed with the instance unless you choose to retain them. |
| The host OS needs a security patch | AWS | OS patching happens in the maintenance window. |
The pattern is consistent. If the problem is about the platform that runs the engine, AWS owns it. If it is about how you configured, connected to, or used the engine, you own it.
Checking the managed settings from the CLI
You can see several of these responsibilities as concrete fields on an existing instance. The following command prints the settings that the customer controls for an instance named demo-pg.
aws rds describe-db-instances \
--db-instance-identifier demo-pg \
--query "DBInstances[0].{Public:PubliclyAccessible,Encrypted:StorageEncrypted,MultiAZ:MultiAZ,BackupDays:BackupRetentionPeriod,MinorUpgrades:AutoMinorVersionUpgrade}"This prints one JSON object with five fields. Each field maps to a decision from the list above. If Public is true or BackupDays is 0, a person made that choice, and a person must change it. You will create demo-pg in a later chapter. You can run the same command against any existing instance in the meantime.
Common misunderstandings
- "Managed" does not mean "highly available." A default single-AZ instance can be unavailable during a host failure, an instance class change, or some maintenance operations. Availability needs Multi-AZ, covered in a later chapter.
- Automated backups are not permanent. They expire after the retention period and are deleted with the instance by default. Manual snapshots persist until you delete them.
- Patching is not fully automatic. Minor version upgrades can be automatic if you allow them. Major upgrades always need your action, and OS-level maintenance still happens at a time you configure.
- RDS does not remove the need for monitoring. AWS publishes the metrics, but you must create the alarms and watch for storage filling up, CPU saturation, and connection exhaustion.
- You cannot reach everything. There is no SSH access and no access to the host filesystem. Some engine features or extensions that need host access are unavailable, so check the engine's RDS documentation before migrating a workload.
Why this matters for the rest of the tutorial
Every later chapter picks up one item from the customer list. The engine, the instance class, and the storage type are your sizing decisions. The VPC placement and the connection method are your exposure decisions. Backups, Multi-AZ, and read replicas are your resilience decisions. When you reach each one, ask what AWS has automated and what you still have to set, test, or watch.
Exercise
A teammate says, "RDS is managed, so we don't need to test restores or set up alarms." Name two reasons this is wrong, and say who owns each task.
Show answer
First, AWS provides the backup mechanism, but you choose the retention period and you are responsible for confirming that a point-in-time restore works and produces usable data. Second, AWS publishes metrics to CloudWatch, but you must create the alarms on free storage, CPU, and connections. Both tasks belong to the customer. Backup retention can even be set to 0, which disables automated backups entirely.
Exercise
An RDS instance in a single Availability Zone becomes unavailable after the underlying host fails. Which responsibility was left unaddressed, and what setting addresses it?
Show answer
High availability is the customer's choice. The instance had no standby because Multi-AZ was not enabled. Enabling a Multi-AZ deployment makes RDS keep a standby in another Availability Zone and fail over to it when the primary fails.