7.1
RDS, Read Replicas and Multi-AZ
Why managed, storage auto scaling, async replicas for reads, sync standby for failover, and Multi-AZ DB clusters.
28 min Reading + animations
Tip: tap or hover any dotted-underlined term to see what it means.
By the end of this lesson you will be able to
- Explain what Amazon RDS manages for you and what stays your job, name its engines, and say why you cannot SSH into it.
- Choose an instance class and a storage type, find the endpoint, and set up storage auto scaling with a sensible maximum threshold.
- Explain how read replicas work (asynchronous, eventually consistent, own endpoints, up to 15), what they cost inside and across Regions, and how to promote one.
- Diagnose the “I edited my post but still see the old one” problem as replica lag and fix it.
- Describe a Multi-AZ DB instance (synchronous standby, one DNS name, automatic failover) and a Multi-AZ DB cluster (one writer, two readable standbys), and convert Single-AZ to Multi-AZ.
- Design cross-Region disaster recovery for RDS, and pick the right answer among read replica, Multi-AZ instance, Multi-AZ cluster and cross-Region replica in any exam question.
#Amazon RDS: a database you do not have to babysit
#Why a managed database
A relational database (an RDBMS) keeps data in tables of rows and columns, joins them with keys, answers SQL queries and protects every transaction with the ACID guarantees. You can install one yourself on an EC2 instance. Then you also own everything around it: the operating system, patches, backups, replication, failover, monitoring, disk growth. That work never ends, and one mistake can lose data.
Amazon RDS (Relational Database Service) runs the database engine for you. You choose an engine, a size and a few settings; AWS runs the servers.
| AWS does it (RDS) | You still do it |
|---|---|
| Provisions the hardware and installs the engine | Choose the engine, version, instance class and storage |
| Patches the OS and the engine in a maintenance window you choose | Design the schema, indexes and queries |
| Takes automated backups and lets you restore to a point in time (lesson 7.2) | Choose retention, take manual snapshots you need for years |
| Builds and fails over a Multi-AZ standby | Decide to pay for Multi-AZ and test failover |
| Creates read replicas when you ask | Send reads to them from your application |
| Grows storage automatically if you allow it | Set the maximum, watch the metrics |
| Publishes CloudWatch metrics and dashboards | Set alarms and react to them |
| Storage on EBS volumes behind the scenes | Network access: VPC, subnets, security groups (lesson 7.4) |
#The engines
RDS runs six engines:
| Engine | Notes |
|---|---|
| PostgreSQL | Open source, very popular for new applications |
| MySQL | Open source, the classic web database |
| MariaDB | A community fork of MySQL |
| Oracle | Commercial; license included or bring your own license (BYOL) |
| Microsoft SQL Server | Commercial; Express, Web, Standard, Enterprise editions |
| IBM Db2 | Commercial; added to RDS in late 2023, BYOL |
Amazon Aurora also lives in the RDS console, but it is AWS’s own cloud-native engine, compatible with MySQL and PostgreSQL, with a different storage design. It has its own lesson (7.3). The owner’s notes list five engines plus Aurora; Db2 is the newer sixth.
#No SSH
RDS is a managed service: AWS owns the host. You connect to the database port (5432 for PostgreSQL, 3306 for MySQL and MariaDB, 1521 for Oracle, 1433 for SQL Server, 50000 for Db2) with a database client. You cannot SSH into the server, see its file system, install agents or patch the OS yourself. That is what makes the patching, backups and failover safe for AWS to automate.
If a legacy application needs OS-level access, custom OS patches or a third-party agent on the database host, standard RDS is the wrong answer. The right answers are RDS Custom (Oracle and SQL Server only, lesson 7.2) or running the database on EC2 yourself.
#Instance classes, storage and the endpoint
Instance classes decide CPU and memory, with the same families you met for EC2 (lesson 4.1), prefixed with db.:
- Burstable (
db.t4g,db.t3): small and cheap, for development and light load. - General purpose (
db.m7g,db.m6i…): balanced CPU and memory. - Memory optimized (
db.r7g,db.x2iedn…): large caches for busy databases.
Changing the class is vertical scaling: the instance restarts, so a Single-AZ database is down for a few minutes. With Multi-AZ, the change is applied to the standby first and the downtime shrinks to one failover (you will see this below).
Storage is EBS underneath (lesson 5.2), and you pick the type:
| Type | Use it for | Key facts |
|---|---|---|
| General Purpose SSD gp3 | Most databases | 3,000 IOPS and 125 MiB/s baseline included (more on bigger volumes); raise IOPS and throughput separately from size |
| General Purpose SSD gp2 | Older setups | IOPS tied to size (3 per GiB), burst credits on small volumes |
| Provisioned IOPS SSD io2 Block Express / io1 | Busy production OLTP that needs steady, low latency | You set the IOPS; io2 is the current choice |
| Magnetic | Legacy only | Cannot use storage auto scaling |
Most engines allow up to 64 TiB per instance (SQL Server 16 TiB).
Every DB instance gets an endpoint: a DNS name such as mydb.c9akciq32xyz.us-east-1.rds.amazonaws.com plus a port. Applications connect to that name, never to an IP address, because RDS moves the name to another machine during failover. Remember this: the endpoint is what makes Multi-AZ failover invisible to the application, and a promoted read replica keeps its own endpoint, which is why promoting one forces a connection-string change.
#Scaling RDS in three directions
| Direction | How | Downtime | Automatic? |
|---|---|---|---|
| Vertical (compute and memory) | Change the instance class, e.g. db.t3.micro → db.m5.large | Reboot: minutes on Single-AZ, one failover on Multi-AZ | No, you change it |
| Horizontal (reads) | Add read replicas and send reads to them | None | No, you create them (RDS has no replica auto scaling) |
| Storage | Storage auto scaling | None | Yes, up to your threshold |
Use vertical scaling when the database itself is short of CPU or memory, and replicas when the load is mostly reads (reports, analytics, product pages).
#Storage auto scaling
With storage auto scaling on, RDS watches free space and grows the volume for you, online. RDS starts a storage increase when all three conditions hold:
- Free space is 10% or less of the allocated storage.
- That low-space condition has lasted at least 5 minutes.
- The previous storage change has finished optimising, and fewer than 4 storage changes have happened in the last 24 hours.
It adds the largest of: 10 GiB, 10% of the current allocation, or the growth it predicts for the next 7 hours from the last hour of the FreeStorageSpace metric.
You must set a maximum storage threshold (--max-allocated-storage): the ceiling auto scaling may reach. It has to be at least 10% above the current size, and AWS recommends at least 26% above, so you get the “approaching the maximum” event before you hit it. Other facts:
- It works for every RDS engine, but not on magnetic storage.
- Turning it on or changing the threshold needs no reboot.
- Storage never shrinks, by auto scaling or by hand. To shrink, create a smaller instance and move the data (for example with a blue/green deployment).
- It is built for slow, unpredictable growth. A huge one-off load can fill the disk faster than auto scaling can follow, and the database then sits in the storage-full state, refusing writes. Allocate space before a big load.
The slides and many older courses give the third condition as “6 hours since the last storage change”. That was the rule until AWS changed it; today it is “optimisation finished and fewer than 4 changes in 24 hours”. If an exam option says 6 hours, it is quoting the old rule; the other two numbers (10% free, 5 minutes) are unchanged.
Storage auto scaling
Storage auto scaling grows the disk of a DB instance when free space runs low, without downtime, up to a maximum storage threshold you set.
Scenario
Storage
| Allocated | Used | Free | Max threshold | Status |
|---|---|---|---|---|
| 100 GiB | 85 GiB | 15% | 200 GiB | available |
The instance has 100 GiB allocated and a maximum storage threshold of 200 GiB. The app keeps inserting rows.
#Read replicas
#How they work
A read replica is a read-only copy of a DB instance. When you create one, RDS takes a snapshot of the source, builds a new instance from it, and then keeps it up to date with the engine’s own replication. The source becomes the primary.
- Replication is asynchronous: the primary commits, answers the application, and ships the change to the replicas afterwards. So replicas run slightly behind, and reads from them are eventually consistent.
- A replica accepts only read-only connections:
SELECTworks;INSERT,UPDATEandDELETEfail. - Each replica has its own endpoint. RDS does not split reads and writes for you: the application (or a proxy, or a Route 53 record you manage) must send reads to replica endpoints and writes to the primary.
- A replica can live in the same AZ, another AZ or another Region.
- A replica is billed as a normal DB instance, with its own class and storage (keep it at least as big as the primary, or it falls behind).
- RDS has no auto scaling for replicas: you add and remove them yourself. (Aurora can auto scale its replicas, lesson 7.3.)
- A replica can be promoted to a standalone database (see below), and a replica can itself be Multi-AZ.
How many replicas can one source have?
| Engine | Replicas per source | Replica of a replica? | Notes |
|---|---|---|---|
| MySQL, MariaDB | 15 | Yes | A MySQL/MariaDB replica can even be made writable (rarely wise) |
| PostgreSQL | 15 | Yes (recent versions) | |
| Oracle | 15 | No | AWS recommends at most 5 to limit lag; also offers mounted (non-readable) replicas for DR |
| SQL Server | 15 | No | Enterprise Edition only; no Multi-AZ replicas |
| Db2 | 3 | No | Read-only or standby (non-readable) replicas |
The owner’s notes say “usually 5”. That was the old limit and still appears in older material; today the quota is 15 per source for most engines, which is also the number the slides use.
#What replicas are for
The main use case is offloading reads. A production database is busy with normal traffic. Now the business wants a reporting or analytics application with heavy queries that scan millions of rows (an OLAP workload). Run it against the primary and every customer feels it. Create a read replica, point the reporting tool at the replica’s endpoint, and the production primary is untouched. Replicas only ever answer SELECT-type statements.
Other uses: serve reads while the primary is briefly unavailable (for example during maintenance, accepting stale data), keep a copy near users in another Region, and disaster recovery by promotion.
Read replicas: spreading reads, and the lag
One primary in AZ a takes every write. Two read replicas in AZ b and AZ c receive the changes asynchronously and serve reads through their own endpoints.
Scenario
Every write (a new post, an edit, a payment) goes to the primary through the primary’s endpoint. Only the primary accepts writes.
#Network cost
AWS normally charges for data that crosses AZ boundaries, and for data leaving a Region. RDS makes one special exception:
| Where the replica is | Replication data transfer |
|---|---|
| Same AZ | Free |
| Another AZ, same Region | Free (the exception) |
| Another Region | Charged as inter-Region data transfer |
You always pay for the replica instance and its storage; the question is only the replication traffic.
#Replica lag and the “old post” problem
This is one of the most famous exam scenarios.
The gap is replica lag (also called replication lag), and the behaviour is eventual consistency: the replicas do not have the change immediately, but they eventually all agree. You can see the lag in seconds in the CloudWatch metric ReplicaLag. It grows when:
- the primary takes a burst of heavy writes;
- the replica is a smaller class than the primary, or short of IOPS;
- long queries on the replica slow down the apply process;
- the replica is in another Region (more network distance).
How to fix it, depending on the requirement:
| Fix | How it works | Trade-off |
|---|---|---|
| Read your own writes | After a user writes, send that user’s reads to the primary for the next few seconds; everyone else keeps reading from replicas | Needs a little routing logic in the app. This is the classic exam answer. |
| Read critical data from the primary | Checkout totals, balances, anything that must be fresh always goes to the primary | More load on the primary |
| Write-through cache | Write the new value to ElastiCache at the same time and read it from there (lesson 7.5) | Another system to run |
| Aurora | Aurora replicas share the storage, so lag is usually under 100 ms | Still asynchronous, never exactly zero |
| Watch the lag | Alarm on ReplicaLag; take a replica out of rotation when it falls behind | Detects, does not prevent |
A Multi-AZ standby does not help: it is synchronous, but nobody can read from it.
#Promoting a replica
You can promote a read replica to a standalone DB instance with one action (aws rds promote-read-replica). What happens:
- The replica stops replicating; the link to the source is broken for good (you cannot reattach it).
- It reboots (a few minutes) and comes back as a normal read/write instance with its own backups.
- It keeps its own endpoint, so applications must be pointed at that new name.
- Anything the primary had not yet shipped (the lag) is not on the promoted copy.
This is how you “write through a read replica”: you can’t, until you promote it, and then it is no longer a replica. Promotion is used for disaster recovery, for splitting a database, and for zero-surprise migrations. It is always manual (or your own automation); RDS never promotes a replica by itself.
Self-checkQuestion
A news site sends all reads to two RDS for MySQL read replicas. Editors complain that after they correct a headline and reload the page, they still see the old headline for a second or two. What is the most likely cause and the best fix?
#Multi-AZ DB instance: availability, not speed
#How it works
With a Multi-AZ DB instance deployment, RDS creates a standby in another AZ of the same Region and keeps it in step with synchronous replication: every write is stored on the primary and the standby before the application hears “committed”.
- One DNS name. The application only knows the endpoint. During failover RDS points that name at the standby, so the application needs no change, only a reconnect.
- Automatic failover, typically 60–120 seconds, with no manual intervention.
- The standby cannot be read. It has no endpoint and accepts no connections. Multi-AZ does not add read capacity and is not a scaling tool.
- No data loss for committed transactions, because both copies have them.
- The price: you pay for the standby (roughly double a Single-AZ instance), and commits are a little slower because each one waits for the second AZ.
- Backups are taken from the standby, so the primary does not pause for them.
RDS fails over automatically when:
| Trigger | Example |
|---|---|
| The primary host is unhealthy or unresponsive | Hardware fault, the engine hangs on CPU or memory |
| Loss of network connectivity to the primary | Network fault in its AZ |
| The primary’s storage fails | EBS volume failure |
| A whole AZ is disrupted | Power or cooling outage |
| OS patching during maintenance | Standby patched first, then failover |
| Some instance modifications | Changing the instance class |
| You ask for it | Reboot with failover, to test your application |
After a failover RDS builds a new standby, so you are protected again.
Two practical details: applications must retry after the connection drops, and must not cache DNS forever. Java applications that connect with JDBC cache DNS answers in the JVM; AWS recommends a DNS TTL of 60 seconds or less (networkaddress.cache.ttl=60). RDS also emits events when a failover starts and ends, which you can send to email or SNS.
Multi-AZ DB instance: one name, two copies
The app always connects to one endpoint, a DNS name. Behind it sit a primary in AZ a and a synchronous standby in AZ b that nobody can query.
Scenario
The app resolves the endpoint. The DNS name points at the primary in AZ a, so the write goes there.
#Single-AZ to Multi-AZ without downtime
You can turn an existing Single-AZ instance into Multi-AZ with Modify → Multi-AZ: Yes (or aws rds modify-db-instance --multi-az). It does not stop the database. Inside, RDS:
- takes a snapshot of the primary’s storage volumes;
- restores new volumes for the standby in another AZ from that snapshot;
- starts synchronous replication between the two, and the status returns to available.
The new volumes load their blocks in the background, so write latency can rise until the standby is fully warmed up. AWS therefore suggests doing it in a quiet period, or, for a sensitive production database, creating a read replica, making it Multi-AZ, letting it catch up, and promoting it.
#Is Multi-AZ disaster recovery?
The slides title Multi-AZ “Disaster Recovery” and the notes call it “HA & DR”. Be precise: Multi-AZ protects against the loss of an instance, its storage or one AZ, all inside one Region. That is high availability. If the whole Region is unavailable, the primary and the standby are both gone. Protection against a Region outage needs a cross-Region read replica (or cross-Region backups, lesson 7.2). In exam answers, “high availability”, “automatic failover” and “survive an AZ failure” mean Multi-AZ; “another Region” means a cross-Region replica.
#Multi-AZ DB cluster: readable standbys
A newer deployment option, easy to confuse with Aurora clusters:
- Three DB instances in three AZs: one writer and two reader instances.
- Semi-synchronous replication: a commit succeeds once at least one reader has the change. Every commit is in at least two AZs, but the writer does not wait for the slower reader.
- The two standbys are readable. A writer endpoint always points at the writer, and a reader endpoint spreads connections over the readers (each instance also has its own endpoint).
- Failover typically under 35 seconds, to the reader with the most recent changes; the writer endpoint moves with it.
- Lower write latency than a Multi-AZ instance, because the instances use fast local NVMe storage for the transaction log.
- Only RDS for MySQL and RDS for PostgreSQL, on instance classes with local NVMe (
db.m6gd,db.r6gdand similar). - Readers still apply changes slightly later, so replica lag and the read-after-write problem still exist.
- It is not Aurora: Aurora shares one storage volume across up to 15 replicas (lesson 7.3).
Multi-AZ DB cluster: one writer, two readable standbys
Three DB instances in three AZs. The writer endpoint always leads to the writer; the reader endpoint spreads reads over the two readers. Only RDS for MySQL and RDS for PostgreSQL offer it.
Scenario
The app sends a write to the writer endpoint, which resolves to the writer in AZ a.
#Disaster recovery across Regions
#The trick question
The owner’s notes include this exam question:
You would like a disaster recovery strategy for your RDS PostgreSQL database so that, during a Regional outage, the database can quickly serve both reads and writes in another Region. The DR database must be highly available. What do you recommend?
The correct answer is create a read replica in a different Region and enable Multi-AZ on the read replica. The tempting wrong answer is “Enable the Multi-Region option on the main database.” Three ideas make it clear:
A read replica can take writes, after promotion
Normally a replica is read-only. In a disaster you promote the replica in the DR Region (say us-west-2, when us-east-1 is down). It stops being a replica and becomes a standalone primary that accepts reads and writes. So “read and write” in the question does not rule out a read replica.
Multi-AZ on the replica makes the DR database highly available
A plain replica, once promoted, is a Single-AZ database: one AZ failure in the DR Region and you are down again. If you enable Multi-AZ on the replica from the start, the replica keeps its own synchronous standby, and the promoted database is highly available from the first minute. That is why the slides note that read replicas can be set up as Multi-AZ for DR.
“Enable Multi-Region” does not exist
Standard RDS has no Multi-Region checkbox. Multi-AZ works only inside one Region. The official way to get an RDS copy into another Region is a cross-Region read replica (cross-Region automated backup replication is the slower, cheaper alternative). The option is invented to confuse you.
Cross-Region read replica for DR
The primary runs in us-east-1. One replica sits in the same Region, another in us-west-2. The question: what does each cost, and what happens when us-east-1 goes down?
Scenario
Normally AWS charges for data that crosses AZs. RDS makes an exception: replicating to a read replica in the same Region is free, even into another AZ. You pay only for the replica instance and its storage.
#Same need, different service, different answer
Exam writers love to put one service’s feature into another service’s options. Match the cross-Region DR feature to the service named in the question:
| The question says | Cross-Region answer |
|---|---|
| RDS (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server) | Cross-Region read replica, promoted manually (enable Multi-AZ on it if the DR copy must be HA) |
| Aurora | Aurora Global Database (storage-level replication, typically under 1 second, managed failover; lesson 7.3), not a read replica |
| DynamoDB or NoSQL | DynamoDB Global Tables (multi-Region, multi-active) |
#Choosing the right option
| Read replica (same Region) | Multi-AZ DB instance | Multi-AZ DB cluster | Cross-Region read replica | |
|---|---|---|---|---|
| Main purpose | Scale reads, reporting | High availability | HA plus some read scaling | Disaster recovery, reads near remote users |
| Replication | Asynchronous | Synchronous | Semi-synchronous | Asynchronous |
| Readable copy? | Yes, via its own endpoint | No | Yes, via the reader endpoint | Yes, via its own endpoint |
| Failover | Manual promotion, new endpoint | Automatic, same endpoint, 60–120 s | Automatic, same writer endpoint, under 35 s | Manual promotion, new endpoint |
| Data loss on failure | Whatever is in the lag | None for committed data | None for committed data (at least one reader has it) | Whatever is in the lag |
| Survives | Nothing by itself | Instance, storage or AZ loss | Instance, storage or AZ loss | Region loss |
| Engines | All six (Db2 up to 3) | All six | MySQL, PostgreSQL | All six (Db2 standby replicas) |
| Extra cost | Replica instances; same-Region transfer free | The standby (about 2×) | Three instances | Replica instance + inter-Region transfer |
The features combine: a primary can be Multi-AZ and have read replicas, and a replica can be Multi-AZ.
Read replica, Multi-AZ or both?
Pick what the database must survive or handle. The answer changes as you click, with the reason, the cost and the words an exam question would use.
1. What is the main need?
2. Which engine?
3. Extra: failover under about 35 s (AZ), or an HA copy after promotion (Region)?
Multi-AZ DB instance
A synchronous standby in another AZ of the same Region. One DNS name: on failure RDS flips the endpoint to the standby in typically 60 to 120 seconds, with no change in the app. The standby cannot be read; this is for availability, not for scaling.
Cost: You pay for the standby too: roughly double a Single-AZ instance.
Exam keywords: high availability, automatic failover without manual intervention, survive an AZ outage, synchronous, same endpoint, minimise downtime during maintenance
#How RDS fits into system design
- Start with Multi-AZ for anything in production. The extra cost buys automatic failover and maintenance with only a short blip. Choose a Multi-AZ DB cluster on MySQL or PostgreSQL when failover time matters or you can use the readable standbys.
- Add read replicas when reads dominate, and design the application for it: a write connection to the primary, a read pool across replica endpoints, read-your-own-writes for anything a user has just changed, and an alarm on
ReplicaLag. - Plan disaster recovery by Region: a cross-Region replica (Multi-AZ if the DR copy must be HA) for minutes of RTO and seconds of RPO, or cross-Region backups for a cheaper, slower plan. Practise the promotion and the connection-string change before you need it, ideally with a Route 53 record (for example
db.example.com) in front of the endpoints. - Turn on storage auto scaling with a realistic threshold, but size storage yourself before planned big loads.
- Keep connection handling robust: retries, short DNS caching, and connection pooling. RDS Proxy (lesson 7.4) shortens failover further and pools connections.
- Migrations: AWS DMS copies an on-premises database into RDS while the source keeps running; promotion of a replica or a blue/green deployment helps with upgrades.
#Try it yourself
# 1. A PostgreSQL instance: Multi-AZ, gp3, storage auto scaling up to 500 GiB
aws rds create-db-instance \
--db-instance-identifier shop-db \
--engine postgres --db-instance-class db.m7g.large \
--allocated-storage 100 --storage-type gp3 --max-allocated-storage 500 \
--multi-az --master-username app --manage-master-user-password \
--db-subnet-group-name private-db --vpc-security-group-ids sg-0abc1234def567890
# 2. Find the endpoint (the DNS name your app uses) and which AZs are in use
aws rds describe-db-instances --db-instance-identifier shop-db \
--query "DBInstances[0].[Endpoint.Address,Endpoint.Port,AvailabilityZone,SecondaryAvailabilityZone,MultiAZ]"
# 3. A read replica in another AZ, and one in another Region (inter-Region transfer is billed)
aws rds create-db-instance-read-replica --db-instance-identifier shop-db-rr1 \
--source-db-instance-identifier shop-db --availability-zone us-east-1c
aws rds create-db-instance-read-replica --region us-west-2 \
--db-instance-identifier shop-db-dr --multi-az \
--source-db-instance-identifier arn:aws:rds:us-east-1:111122223333:db:shop-db
# 4. Watch replica lag (seconds) on the replica
aws cloudwatch get-metric-statistics --namespace AWS/RDS --metric-name ReplicaLag \
--dimensions Name=DBInstanceIdentifier,Value=shop-db-rr1 \
--start-time 2026-10-25T10:00:00Z --end-time 2026-10-25T11:00:00Z \
--period 60 --statistics Maximum
# 5. Test failover: reboot with failover, then see the AZs swap
aws rds reboot-db-instance --db-instance-identifier shop-db --force-failover
aws rds describe-events --source-identifier shop-db --source-type db-instance --duration 60
# 6. Convert a Single-AZ instance to Multi-AZ (no downtime)
aws rds modify-db-instance --db-instance-identifier legacy-db --multi-az --apply-immediately
# 7. Disaster: promote the cross-Region replica (replication ends for good)
aws rds promote-read-replica --region us-west-2 --db-instance-identifier shop-db-dr
# 8. A Multi-AZ DB cluster (MySQL or PostgreSQL only): writer + 2 readable standbys
aws rds create-db-cluster --db-cluster-identifier orders-cluster \
--engine postgres --db-cluster-instance-class db.r6gd.large \
--storage-type io2 --iops 3000 --allocated-storage 100 \
--master-username app --manage-master-user-password
aws rds describe-db-clusters --db-cluster-identifier orders-cluster \
--query "DBClusters[0].[Endpoint,ReaderEndpoint]"
On the replica, writes fail and reads work, and you can see how far behind it is:
-- PostgreSQL replica
SELECT pg_is_in_recovery(); -- true on a replica
SELECT now() - pg_last_xact_replay_timestamp() AS lag;
UPDATE posts SET title = 'x' WHERE id = 1; -- ERROR: cannot execute UPDATE in a read-only transaction
-- MySQL replica
SHOW REPLICA STATUS\G -- Seconds_Behind_Source
#Summary
Key takeaways
- RDS is a managed relational database: AWS handles hardware, OS and engine patching, backups, Multi-AZ failover and replicas; you handle schema, queries, sizing and access. Engines: PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, IBM Db2 (Aurora is separate). No SSH; for OS access use RDS Custom (Oracle, SQL Server) or EC2.
- Connect through the endpoint (a DNS name). Storage is EBS: gp3 for most, io2 for steady high IOPS. Changing the instance class is vertical scaling with a reboot.
- Storage auto scaling: when free space ≤ 10% for 5 minutes and the last change has finished optimising (≤ 4 changes in 24 h; older material says 6 hours), RDS adds the largest of 10 GiB, 10% or the predicted 7-hour growth, up to your maximum storage threshold. No downtime; storage never shrinks.
- Read replicas: up to 15 per source (Db2: 3), same AZ, cross-AZ or cross-Region, asynchronous, eventually consistent, read-only (
SELECT), each with its own endpoint; the app must send reads there. Use them for reporting and read-heavy load. Same-Region replication is free, cross-Region is billed. - Replica lag explains “I updated it but see the old data”. Fix with read-your-own-writes from the primary, a cache, or Aurora; watch
ReplicaLag. - Promoting a replica makes it a standalone read/write database, ends replication, keeps its own endpoint, and is always manual. Replicas never fail over automatically.
- Multi-AZ DB instance: synchronous standby in another AZ, one DNS name, automatic failover in 60–120 s, standby not readable, not for scaling, about double the cost. Single-AZ → Multi-AZ is online: snapshot, restore in another AZ, then sync.
- Multi-AZ DB cluster: one writer + two readable standbys in three AZs, semi-synchronous, reader endpoint, failover under 35 s, MySQL and PostgreSQL only.
- Cross-Region DR for RDS = cross-Region read replica, promoted manually; enable Multi-AZ on the replica if the DR database must be HA. “Multi-Region option” does not exist. Aurora → Global Database; DynamoDB → Global Tables.
Answer on your own first, then read the explanation, even when you got it right.
Self-checkQuestion
Which of these is NOT a database engine you can choose when you create a standard Amazon RDS DB instance?
Self-checkQuestion
A team wants to install a third-party monitoring agent directly on the operating system of its database server and apply custom OS patches. The database is Oracle. Which option meets the requirement while keeping as much management by AWS as possible?
Self-checkQuestion
What does an application use to connect to an RDS DB instance?
Self-checkQuestion
Under which conditions does RDS storage auto scaling start increasing storage today? Choose two.
Choose 2
Self-checkQuestion
An RDS for MySQL instance has 200 GiB allocated and storage auto scaling turned on. Free space has been at 8% for ten minutes, and no recent storage change is running. RDS predicts only small growth over the next 7 hours. By how much does it increase the storage?
Self-checkQuestion
A startup’s RDS PostgreSQL database grows unpredictably and has run out of storage twice. The team wants this to stop without downtime and without paying for far more storage than needed. What should a solutions architect do?
Self-checkQuestion
During a one-off migration, 400 GiB is loaded within two hours into a 100 GiB RDS instance with storage auto scaling on and a 2,000 GiB threshold. The instance goes into the storage-full state for several hours. Why, and what should have been done?
Self-checkQuestion
An online game stores player profiles in a MySQL-compatible relational database. Traffic is very spiky and unpredictable, and the company wants the database’s CPU and memory to scale up and down automatically. Which option meets this requirement?
Self-checkQuestion
What is the maximum number of read replicas you can create from one RDS for PostgreSQL source DB instance by default?
Self-checkQuestion
Which two statements about RDS read replicas are true?
Choose 2
Self-checkQuestion
A company’s business analysts run long reporting queries against the production RDS for MySQL database every morning, and customer response times suffer. The reports can tolerate data that is a few seconds old. What is the most cost-effective solution?
Self-checkQuestion
A primary RDS for MySQL instance in us-east-1a has one read replica in us-east-1b and one in eu-west-1. Which data transfer charges apply to replication?
Self-checkQuestion
A social-media app writes posts to an RDS primary and reads every page from read replicas. Users report that right after editing a post and refreshing, they see the old version, but a few seconds later the new one appears. What explains this?
Self-checkQuestion
For the app in the previous question, the product owner wants authors to always see their own edits immediately, while other users may see them a little later. Which change achieves this with the least cost?
Self-checkQuestion
Which two factors are likely to increase replica lag on an RDS read replica?
Choose 2
Self-checkQuestion
The primary of an RDS for PostgreSQL deployment fails. It has two read replicas and no Multi-AZ. What happens?
Self-checkQuestion
What happens when you promote an RDS read replica?
Self-checkQuestion
Which statement about the standby in a Multi-AZ DB instance deployment is correct?
Self-checkQuestion
A company runs an RDS for SQL Server database in a single AZ. Management requires that the database survive the loss of an Availability Zone automatically, without any change to application connection strings. What should a solutions architect do?
Self-checkQuestion
How long does an automatic failover of an RDS Multi-AZ DB instance typically take, and how long for a Multi-AZ DB cluster?
Self-checkQuestion
Which two events can cause an RDS Multi-AZ DB instance to fail over to its standby automatically?
Choose 2
Self-checkQuestion
An application on EC2 written in Java keeps failing for many minutes after every RDS Multi-AZ failover, although the database is back after about two minutes. Restarting the application fixes it. What is the most likely cause?
Self-checkQuestion
A company wants to convert a production RDS for MySQL instance from Single-AZ to Multi-AZ. What happens when it applies the change?
Self-checkQuestion
A production RDS for MySQL Multi-AZ DB instance must move from db.m6g.large to db.m6g.2xlarge. What impact should the team expect?
Self-checkQuestion
Which two statements describe a Multi-AZ DB cluster deployment of RDS?
Choose 2
Self-checkQuestion
An RDS for PostgreSQL application needs failover in well under a minute and extra read capacity, without managing separate replica endpoints. Which deployment fits best?
Self-checkQuestion
You need a DR strategy for an RDS PostgreSQL database so that, in a Regional outage, the database can quickly serve reads and writes in another Region, and the DR database must be highly available. What do you recommend?
Self-checkQuestion
A company runs Amazon Aurora MySQL and needs cross-Region disaster recovery with an RPO of about one second and an RTO of about a minute. Which feature should it use?
Self-checkQuestion
Study notes say: ‘RDS Multi-AZ = High Availability and Disaster Recovery; read replicas: up to 5.’ What is the most accurate correction?
Self-checkQuestion
A company needs read performance for users in Europe from an RDS database in us-east-1 and must keep costs as low as possible. A cross-Region read replica in eu-west-1 is proposed. Which statement is accurate?