Relational Database Service Flashcards
Two types of DB transaction models and what do they prioritize ?
ACID = Consistency
Base = Availability
What does ACID stand for ?
Atomic - All or No components of a transaction succeeds or fails
Consistent- Transaction move the database from one valid state to another
nothing in-between is allowed
Isolated- If multiple transactions occur at once, they don’t interfere with each other
Each executes as if it’s the only one
Durable- once committed transaction are durable . stored on non-volatile memory, resilient to power outages or crashes
What does Bases stand for ?
Basically Available- Read and Write are available ‘as much as possible’ but without any consistency guarantees- kinda,maybe
Soft State - The database doesn’t enforce consistency, this is offloaded onto the application /user
Eventually Consistent - if we wait long enough, reads from the system will be consistent
Database on EC2
mostly always a bad idea so much you have to question it’s use case every being needed
What is Relational Database Service (RDS) ?
DatabaseServer-as-a service
Managed database instance (1+ databases)
multiple engines Mysql, mariaDB, postgreSQL , oracle, microsoft SQL server
RDS MultiAZ
standby read replica incases of AZ outages, primary failure , software patching etc.
Can RDS MuliAZ read replicas be used for extra capacity ?
No standby’s can never be directly used
When a fail over happens what is the time it takes to move to the replica instance?
failover 60-120 seconds highly available but not fault tolerant
Cost for RDS MultiAZ
No free-tier extra cost for standby replica usually 2x the price
Recovery Point Objective (RPO)
Time between last backup and incident
Amount of Maximum data loss
influences technical solution & cost
Generally lower value cost more
Recovery Time Objective(PTO)
Time between the DR even and full recovery
Influenced by process,staff, tech and documentation
Generally Lower value cost more
How are RDS backups taken
taken from the standby instance if MultiAz is enabled if not enabled taken from Main instance first snapshot is a full snapshot then after onwards they are taken incrementally
backups is restored and transaction logs are ‘replayed’ to bring DB to desired point int time
How often are snapshots and backups taken ?
RDS provides automatic backups or manual snapshot when ever your specific
How Is RDS able to restore from any point into time ?
RDS captures transaction logs every 5 mins which captures the transactions done on the databases
Where are snapshots, backups, and logs stored ?
Aws managed s3 bucket
Read Replicas
you can have 5 direct read-replicas per DB instance
they have their own endpoints and can only be used for read operations
What is the problem with creating a read-replica from a read-replica ?
lagging starts to be problem