Row Store
Stores data in rows
Good for Transactional DB. OLTP
This is important if the Data will be queried (CRUD) for all rows at once at all times. Eg, Sales record.
Example AWS: ** MySQL
Column Store
Columns are stored together. Ideal for reporting or when all values for a specific attribute (size) are required.
OLAP
- This is good for Inventories and reporting.
- Data warehouse
- Analytics
You can take data from an OLTP into a Column store for reporting and analytics
eg AWS: REDSHIFT
Graph DB
Data, alongside their relationships, are stored in the DB, hence querying the data returns results really fast.
Best for systems with complex sophisticated Relationships
Justifications for DB on EC2
DB on EC2 CONS
Command to migrate a mysQl DB into a file
$ mysqldump -u root -p alwordpress > a41wordpress.sql
RDS
RDS is a VPC service. It is deployed into a subnet
RDSMulti-AZ Deployment
Without indication, in a Multi-AZ setup, RDS will randomly select any two subnets in two AZs for its deployment; one for its Primary, and the other, standby DB, all within its Subnet Group
RDS Instance Architecture
An RDS Instance can have more than one Database on them
Every RDS Instance (Master and Standby) has its own dedicated EBS Storage
AWS
Note that RDS for SQL Server has a limit of up to 100 databases on a single DB instance.
RDS Replication
Synchronous: Data is replicated to standby as soon as it arrives.
Read Replicas are Asynchronously replicated. This can be same AZ, Multi AZ, or Multi Region.
Read replicas are used to create resilience, HA , and to scale read workloads.
RDS Backup
In Multi Az mode, backup happens on the standby instance, hence, extremely short downtime
RDS Free Tier
Single AZ
Functions of the RDS Standby Instance
For Failover Only
And then Backups to S3
RDS Failover notable events
DB CNAME changes from the Primary DB Endpoint to the Standby Endpoint Url.
Failover to a Standby can take up to 60s-120s. This is to enable DNS Endpoint swapping
RDS Multi AZ Cluster vs Multi Az instance
while
RDS Consistency model
RDS data is considered Confirmed after Main and Standby/RR are committed
RDS Backup
RDS Snapshot
Automated Backup content
Automated snapshots contains DB data, and Transaction logs(5min granularity)
Automated backups takes place once a day, during the backup window.
Backup retention
0 days - No Backup
35days - Max
RDS Restore (Snapshot/Backup)
During RDS Restore, RDS Deploys a brand new DB, hence Applications need to be updated with the new endpoint.
RDS Restore RTO
Depending on the amount of data on the DB
RDS Read Replica
They are eventually consistent. and have their own separate endpoint.
Without Application support, RR are useless.
RR do not perform Automatic failover.
Once Cross-Region is selected, AWS Handles the Networking.
Note: Synchronous - Multi AZ
Asynchronous: Read Replica
RDS Encryption