AWS RDS Read Replicas
- Lets create the database with backups enabled and minor version upgrades with free tier.
- Enable Backup
- Once you configure the backups we can view the configuration in Automated Backups section.
- Lets connect to the database
- Create the database
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
* Lets insert some data into it.
INSERT INTO `employees`.`Persons` VALUES (1, 'one','one','one','one');
INSERT INTO `employees`.`Persons` VALUES (2, 'two','two','two','two');
select * from employees.Persons;
- This database allows us to read and write. Lets create a read replica.
- When we need to make read replica a primary database then we do promote-read replica.
- This will stop all the replication rules.
- THe database supports writing the data.
- When a database exists in one region and if we want the same in other region, we have two options
- backup based: Restore from snapshot and create the database in other region
- read-replica and promotion: Create a read replica from primary database and then promote the read replica.
Multi Az Deployment
- In this mode RDS instance will be created in more than one zone.
Next Steps:
- Exporting Data into S3 and Restoring to Create a new db
- What is aurora ?