[AWS Cloud Fundamental Notes] RDS
Introduction to RDS and its usage and operational mechanism
Setting up, operating, and scaling relational databases in the cloud is just a few clicks away.
Type | Control | Database Engine | Management |
---|---|---|---|
Self-built | System-level | Free choice | Self-planned availability and redundancy |
RDS | Limited | Limited support | Provides snapshot and backup mechanisms |
Redundancy and High Availability
Multi-AZ Cross-Region Synchronous Backup Deployment
Utilizes a “multi-institution deployment” high-availability solution, preparing database systems in different Availability Zones (AZ) respectively.
A “master-slave database” is established between different AZs using Subnet Groups.
The data from the primary database is synchronously replicated to the backup database, incurring higher costs.
Snapshot Solution
Regular automatic backups are taken of the primary database and can also be done manually.
When deleting an RDS instance:
- Regular backups: Only the last backup is kept.
- Manual backups: All are retained.
Read Replicas for Read-Only Replicas
To alleviate the traffic on the primary database, a “read-only replica” service can be used to receive data query tasks.
Read Replicas asynchronously replicate with the primary database and can quickly restore the database.
Common Architectures
Through the Multi-AZ feature, because the primary and backup databases are synchronized in real-time, the tasks of creating Snapshots and Read Replicas can be handed over to the backup database.
The read-write burden on the primary database is reduced, and once the primary database stops working, it can be quickly switched to the backup database.
Multi-AZ | Read Replica |
---|---|
Mainly for high availability | Mainly for scalability |
Synchronous replication | Asynchronous replication |
Only the primary instance is active | All can be accessed and used for read scaling |
Crosses at least two available zones within a single region | Can be within a single availability zone, across availability zones, or across regions |
Performance Tuning
Using Parameter Groups
Since RDS does not open up the underlying operating system, it provides the Param Groups feature for easy tuning of database parameters.
Security
RDS Proxy
To assist in managing database connections, AWS has introduced RDS Proxy
to simplify RDS database instance connection management.
When multiple servers request access to the database, RDS Proxy can help manage the database connections, avoiding database (and engineer) crashes due to a large number of connections.
It allows applications to connect to RDS Proxy via IAM permissions without exposing the database account password, securely storing the credentials in AWS Secrets Manager .
By using RDS Proxy in conjunction with Secret Manager to assist in connecting to the database, employees can connect to the database without knowing the account password, enhancing connection security.