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
How can read replicas improve RTO recovery ?
any one of the read replicas can be promoted to writes improving RTO
If a failure happens because of a data corruption would there be any difference in how you would restore that DB instance ?
yes you can replicate the data corruption if you just promote a read replica to a write instance
for that you would default to backups and snapshots
Resiliency of read replicas
global availability improvements global resilience
How is RDS encryption handled in Transit ?
Encryption can be be set via SSL/TLS and be set to a mandatory on a per user basis
How is RDS encryption at rest handled ?
RDS supports EBS volume encryption using KMS
Handled by Host/EBS the RDS instance is not aware of encryption
Can RDS encryption be removed once added ?
no
Once encryption on RDS is enable what other resource would the encryption extend to ?
Storage, Logs , Snapshots and replicas
Are there other Options for RDS encryption
RDS MySQL and RDS Oracle supports Transparent Data Encryption (TDE)
Encryption is handled within the DB engine
RDS Oracle supports integration with CloudHSM
How does Amazon RDS IAM Authentication Work ?
RDS local DB account configured to use AWS Authentication Token
Policy attached to users or roles maps that IAM identity onto the local RDS user
generate-db-auth-token creates a token with 15 min Validity which can be used in place of a DB user password
Aurora Architecture
uses a ‘Cluster’
a signinle primary instance with 0 or more replicas
No local storage uses cluster Volume
When to use Aurora ?
Any needs beyond RDS singleAz (micro) Aurora offers better value
Aurora Charges
No free-tier option
compute - hourly charge per sec 10 min minimum
storage- gb month consumed IO cost per request
100% DB size in backups are included
Aurora Serverless
Scalable -ACU Aurora capacity units
Aurora Serverless Cluster has a min & max ACU
cluster adjust based on load can go to 0 and be paused
How is Aurora serverless billed ?
consumption based per-second basis
same resilience as aurora 6 copies across AZ
you have an application where your’re billing a user a set $ amount per month per license to the application where income load = incoming revenue what resource would you use ?
Aurora
What are some other use cases for Aurora serverless?
infrequently used applications
new applications
variable workloads
unpredictable workloads
development and test database
Database Migration Service(DMS)
managed DMS
runs using a replication instance
sources and destination endpoints points at => sources and target database
one endpoint must be on AWS
DMS Schema Conversion Tool (SCT)
SCT is used when converting one database engine to another
including DB → s3 (migration using DMS)
What type of Database are compatible with DMS Schema Conversion Tool (SCT)
works with OLTP db type (mySQL, MSsql, oracle)
and OLP(Teradata , oracle, vertica , Green plum )
When would you not use DMS Schema Conversion Tool (SCT) ?
When migrating between DB’s of the same type
When would you use DMS and SnowBall
when migrations are multi-TB in size
moving dtata over networks takes time and consume cpacity
DMS can utilise snowball
What’s the process of using DMS with snowball ?
- use SCT to extract data locally and moveto a snowball device
- ship the device back to AWS they load onto an s3 bucket
- DMS migrates from s3 into the target store
- change data capture(CDC) can capture changes, and via s3 intermediary they also write to the target databases
Aurora Global Database
up to 16 read only Replicas in secondary regions
currently Max is 5 secondary regions
the other region replicas can also be used for read during normal business operations
Why would you user Aurora Global Database ?
cross-region Disaster recovery and business continuity
How log does it take to Aurora Global Database to replicate data to the secondary region ?
1 s or less replication between regions
No impact on DB performance
What is -Aurora Multi-Master and how does it work ?
In multi-master mode all instances are R/W
changes get prosed to all nodes
and quorum of nodes have to be in agreement for the changes to be accepted
if rejected the user would get an error
if approved the changes get replicated and the instances update their memory-caches
If you were trying to build a fault tolerant application what AWS DB service would you use to build it ?
Aurora Multi master since all instances are r/w any one of the instances can be promoted when a writer fails it can immediately send operations to another instance meaning little or if any disruption