Sikau

AWS · Day 10 · about 40 min

RDS and Multi-AZ

Managed databases, automatic failover and read replicas.

Someone else does the 3am work

Running your own database means patching it, backing it up and rebuilding it when a machine dies. RDS is the Relational Database Service: you pick PostgreSQL, MySQL or another engine and AWS handles the operating system, patches, backups and failover. You still design the schema, write the queries and control who can connect.

RDS gives you two different tools that people often mix up: Multi-AZ is for staying up, and read replicas are for handling more reads. They solve different problems.

Multi-AZ keeps you alive

With Multi-AZ, RDS keeps a standby copy in a different Availability Zone. Every write goes to both copies before it counts as done (synchronous replication). If the primary's machine or zone fails, AWS promotes the standby and points the same endpoint name at it. Your app reconnects, usually within a minute or two, and no committed data is lost.

In the classic single-standby setup, the standby is not there to answer queries. It exists only to take over. Adding it does not make reads faster.

The rest of this lesson

  • Replicas keep you fastexplain
  • A zone failsorder
  • Which feature?match
  • A stale readpredict
  • Failover and lagwrite code
  • Badge quizquiz
  • What you learnedrecap

Continue this lesson free — run real code in your browserright here

Continue with Google

See all 13 lessons of AWS