Amazon Relational Database Service - Part1
Amazon Cloud Concepts Learning --> Day23
Amazon Relational Database Service
Provides Relational Database service
Amazon RDS is an Online Transaction Processing (OLTP) type of database.
It works well with needs for relational, structured data stores.
The goal is to replace current on-premises instances of the identical databases with a drop-in solution.
Patching and automated backups are implemented at customer-specified maintenance times.
Redundancy, replication, and scalability using push buttons.
Supports MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and the new, MySQL-compatible Amazon Aurora DB engine.
You do not have root access to the underlying EC2 instance since RDS is a managed service.
Point in Time recovery is made possible by daily scheduled backups that include database transaction records, allowing access to the latest five minutes of database activity.
User-initiated storage volume snapshots of the database instance are called snapshots, and they back up the whole database instance—not just certain databases that may be restored as separate RDS instances.
Database instances are accessed via endpoints.
Amazon RDS DB Instances
An isolated database environment operating in the cloud is called a DB instance. It is the fundamental component of Amazon RDS.
Up to 40 Amazon RDS DB instances are permitted.
A DB engine is used by every DB instance.
A DB instance's computation and memory capacity are configurable based on its DB instance class. It is possible to switch DB instances as your needs evolve over time.
The minimum and maximum storage needs for each database instance vary based on the kind of storage and database engine that it supports.
A multi-AZ deployment is an option that allows you to execute your database instance across several AZs.
In a separate AZ, Amazon automatically creates and maintains a backup database instance. Synchronous replication of your primary database instance is done across AZs to the secondary instance for data redundancy, failover support, removal of I/O freezes, and reduction of latency spikes during system backups.
Maintenance windows are set up to enable changes to database instances, including software patches and scalability (some activities necessitate a temporary down period for the database instance).
AWS will provide a 30-minute window, or you can choose your own.
Amazon RDS Read Replicas
A read replica is a clone of a database that can only be read.
Read replicas are used for read-heavy DBs and replication is asynchronous.
By sending your apps' queries to the read replica, you may lighten the workload on your primary database server.
Read replicas are made using the master instance's snapshot.
Supported only with storage engines for transactional databases.
For MySQL, PostgreSQL, MariaDB, Oracle, Aurora, and SQL Server, read replicas are available.
A production database may have up to five read replicas.
You can specify the AZ the read replica is deployed in.
Although the read replicas' instance class and storage type may differ from the source, the computation should at the very least match the source's performance.
The read replicas are moved to the new primary in a multi-AZ failover.
Explicit deletion of read replicas is required.
Read clones need several minutes to promote.
Cannot create encrypted read replicas from unencrypted DB or read replica
A source database instance is replicating to a read replica in a separate Availability Zone (AZ) as seen in the accompanying figure. Clients can read and write on the primary database instance, whereas they can only access the replica.
Amazon RDS Multi-AZ Deployment
Multi-AZ deployments can have one standby or two standby DB instances.
RDS multi-AZ deployments give database instances automated failover and high availability.
Multi-AZ DB Instance deployment
A deployment is referred to as a multi-AZ DB instance deployment when it contains a single standby DB instance.
Provides failover support, but does not serve read traffic.
Amazon RDS automatically creates and manages a synchronous standby replica in a separate Availability Zone.
During system backups, the primary database instance is synchronously replicated to a standby replica across Availability Zones to avoid latency spikes and provide data redundancy.
The following traits are present in a multi-AZ DB instance deployment
The value of multi-AZ is Yes.
There is only one row for the DB instance.
The value of Role is Instance or Primary.
Multi-AZ DB Cluster deployment
A deployment is referred to as a Multi-AZ DB Cluster deployment when it contains two standby DB instance.
Serves read traffic and offers failover assistance.
A semi-synchronous, high availability Amazon RDS deployment strategy with two readable replica databases.
A writer database instance and two reader database instances in three different Availability Zones within the same AWS Region.
Compared to multi-AZ DB instance deployments, multi-AZ DB clusters offer higher availability, more capacity for read workloads, and reduced write latency.
Multi-AZ DB clusters typically have lower write latency when compared to Multi-AZ DB instance deployments.
Using the inherent replication capabilities of the DB engine, Amazon RDS duplicates data from the writer DB instance to both reader DB instances.
Needs acknowledgement from a minimum of one reader database instance before a modification is committed.
In addition to serving read traffic to boost application read throughput, reader database instances function as automated failover targets.
The following traits are present in a multi-AZ DB Cluster deployment
There is a cluster-level row with three DB instance rows under it.
For the cluster-level row, the value of Role is multi-AZ DB cluster.
For each instance-level row, the value of Role is Writer instance or Reader instance.
For each instance-level row, the value of multi-AZ is 3 Zones.
Comparison between Multi-AZ DB Instance Deployment & Multi-AZ DB Cluster Deployment
Multi-AZ DB Instance Deployment
Replication Mode --> Synchronous replication
Failover Time --> Up to 120 seconds based on crash recovery
Availability Zone --> 2 AZ’s
Automatic failover --> Yes
Purpose --> Failover Support
Multi-AZ DB Cluster Deployment
Replication Mode --> Semi- Synchronous engine-native replication
Failover Time --> 25-75 seconds typically depends on replica lag
Availability Zone --> 3 AZ’s
Automatic failover --> Yes
Purpose --> Failover Support and Serve Read Traffic
Note: All Images are from AWS Official Document
References: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html
"Thank you for reading! If you found this blog helpful, don't forget to subscribe and follow for more insightful content. Your support keeps me motivated to bring you valuable insights. Stay updated and never miss out on our latest posts. Feel free to leave comments or suggestions for future topics. Happy learning!"
https://awslearner.hashnode.dev/amazon-web-services-via-category
Subscribe to my newsletter
Read articles from Utkarsh Rastogi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Utkarsh Rastogi
Utkarsh Rastogi
👨💻 AWS Cloud Engineer | Around 6 years of Corporate Experience | Driving Innovation in Cloud Solutions 🔧 Day-to-Day Tasks: Specialize in creating AWS infrastructure for Migration Projects. Leveraging services such as S3, SNS, SQS, IAM, Lambda, System Manager, Kinesis, OpenSearch, Cognito, Storage Gateway, Cloud Watch, API Gateway, AWS Event Scheduler, Secret Manager, ECS, Application Load Balancer, VPC among others. Additionally, I excel in crafting Splunk Dashboards and implementing alerting mechanisms for Cloud Watch logs to monitor failures. My approach involves constructing AWS infrastructure using the Serverless framework and Cloud Formation templates, while automating tasks through Boto3 (Python Scripting) Lambdas. 🎯 Passion: I am deeply passionate about continuously learning new technologies and eagerly anticipate the transformative impact of cloud computing on the tech landscape. 📧 Connect: Feel free to reach out to me at awslearningoals@gmail.com. Let's connect and explore potential collaborations! https://www.linkedin.com/in/rastogiutkarsh/