RDS, Aurora & ElastiCache Flashcards

1
Q

What is Amazon RDS?

A
  • It’s a managed DB service for DB use SQL as a query language.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the supported RDS engines?

A
  • Postgres
  • MySQL
  • MariaDB
  • Oracle
  • Microsoft SQL Server
  • Aurora (AWS Proprietary database)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages to RDS vs EC2 with db?

A
  • Automated provisioning, OS patching
  • Continuous backups and restore to specific timestamp (Point in Time Restore)!
  • Monitoring dashboards
  • Read replicas for improved read performance
  • Multi AZ setup for DR (Disaster Recovery)
  • Maintenance windows for upgrades
  • Scaling capability (vertical and horizontal)
  • Storage backed by EBS (gp2 or io1)

BUT you can’t SSH into your instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is RDS - Storage Auto Scaling?

A
  • Helps you increase storage on your RDS DB instance
    dynamically
  • When RDS detects you are running out of free database
    storage, it scales automatically
  • Avoid manually scaling your database storage
  • You have to set Maximum Storage Threshold (maximum limit for DB storage)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is auto scaling used?

A

Useful for applications with unpredictable workloads * Supports all RDS database engines (MariaDB, MySQL,
PostgreSQL, SQL Server, Oracle)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are RDS Read Replicas?

A

Async replications of the main db. Reads are eventually consistent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the main features of Read Replicas?

A
  • Up to 15 Read replicas
  • Within AZ, Cross AZ or Cross Region
  • Can be promoted to main DB
  • App must handle connection string change to read from them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Whats the uses cases of Read Replicas?

A

Prod application writes to main db. Reporting application reads the data from the replica.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the network costs for read replicas?

A

They are free within a region but cross region you have to pay for it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is RDS Multi AZ (Disaster Recovery)?

A

Sync replication of the main db. Its a standby in case of failover.
* One DNS name – automatic app
failover to standby
* Increase availability
* Failover in case of loss of AZ, loss of network, instance or storage failure
* No manual intervention in apps
* Not used for scaling
* Note:The Read Replicas be setup as
Multi AZ for Disaster Recovery (DR)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can you move Single AZ RDS to Multi-AZ?

A

Yes you can. It has zero downtime. Click on “modify” and change it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Amazon Aurora?

A

Aurora is “AWS cloud optimized” and claims 5x performance improvement
over MySQL on RDS, over 3x the performance of Postgres on RDS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the main advantages of Aurora?

A
  • Aurora storage automatically grows in increments of 10GB, up to 128 TB.
  • Aurora can have 15 replicas while MySQL has 5, and the replication process
    is faster (sub 10 ms replica lag)
  • Failover in Aurora is instantaneous. It’s HA (High Availability) native.
  • Aurora costs more than RDS (20% more) – but is more efficient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Aurora High Availability and Read Scaling?

A
  • 6 copies of your data across 3 AZ:
  • 4 copies out of 6 needed for writes
  • 3 copies out of 6 need for reads
  • Self healing with peer-to-peer replication
  • Storage is striped across 100s of volumes
  • One Aurora Instance takes writes (master)
  • Automated failover for master in less than 30 seconds
  • Master + up to 15 Aurora Read Replicas serve reads
  • Support for Cross Region Replication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 2 endpoints of an Aurora DB Cluster?

A
  • Writer endpoint => pointing to Master db
  • Reader endpoint => Connection to Load Balancing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 2 db engines supported by aurora?

A

MySql, Postgre

17
Q

What are the features of Aurora?

A

Automatic fail-over
* Backup and Recovery
* Isolation and security
* Industry compliance
* Push-button scaling
* Automated Patching with Zero Downtime
* Advanced Monitoring
* Routine Maintenance
* Backtrack: restore data at any point of time without using backup

18
Q

What are the features of Aurora?

A
  • Automatic fail-over
  • Backup and Recovery
  • Isolation and security
  • Industry compliance
  • Push-button scaling
  • Automated Patching with Zero Downtime
  • Advanced Monitoring
  • Routine Maintenance
  • Backtrack: restore data at any point of time without using backup
19
Q

What are the security options for RDS?

A
  • Encryption, to encrypt/unencrypt db create DB snapshot & restore as encrypted
  • In-flight encryption: TLS ready by default, AWS TLS
  • IAM Auth: IAM roles to connect to your db
  • Security Groups: Control Network access to your RDS
  • No SSH
  • Audit Logs can be sent to CW for longer retention
20
Q

What is Amazon RDS proxy?

A
  • Fully managed database proxy for RDS
  • Allows apps to pool and share DB connections established with the database
21
Q

What the usage of RDS Proxy?

A
  • Improving database efficiency by reducing the stress
    on database resources (e.g., CPU, RAM) and
    minimize open connections (and timeouts)
  • Serverless, autoscaling, highly available (multi-AZ)
  • Reduced RDS & Aurora failover time by up 66%
  • No code changes required for most apps
  • Enforce IAM Authentication for DB, and securely store credentials in AWS Secrets Manager
  • RDS Proxy is never publicly accessible (must be
    accessed from VPC)
22
Q

You have a MySQL RDS database instance on which you want to enforce SSL connections. What should you do?

A

Execute a <code>REQUIRE SSL</code> SQL statement to all your DB users

23
Q

What is Elastic Cache?

A

ElastiCache is to get managed Redis or Memcached.
Caches are in-memory databases with really high performance, low
latency.
* Using ElastiCache involves heavy application code changes

24
Q

What is one of the main Elastic Cache usage?

A

User Session Store.

25
Q

What are the Elasti Cache Redis features?

A
  • Multi AZ with Auto-Failover
  • Read Replicas to scale reads and have high availability
  • Data Durability using AOF persistence
  • Backup and restore features
  • Supports Sets and Sorted Sets
26
Q

What are the Elasti Cache Memcached features?

A
  • Multi-node for partitioning of data (sharding)
  • No high availability (replication)
  • Non persistent
  • No backup and restore
  • Multi-threaded architecture
27
Q

What are the pros & cons of Lazy Loading / Cache-Aside/ Lazy Population?

A
  • Pros
  • Only requested data is
    cached (the cache isn’t filled
    up with unused data)
  • Node failures are not fatal
    (just increased latency to
    warm the cache)
  • Cons
  • Cache miss penalty that
    results in 3 round trips,
    noticeable delay for that
    request
  • Stale data: data can be
    updated in the database and
    outdated in the cache
28
Q

What is Write Trough caching strategy?

A

Update cache after write to db.

29
Q

What are the pros & cons of Write Trough?

A
  • Pros:
  • Data in cache is never
    stale, reads are quick
  • Write penalty vs Read
    penalty (each write
    requires 2 calls)
  • Cons:
  • Missing Data until it is
    added / updated in the
    DB. Mitigation is to
    implement Lazy Loading
    strategy as well
  • Cache churn – a lot of the
    data will never be read
30
Q

Whats the 3 type of cache evictions?

A
  • You delete the item explicitly in the cache
  • Item is evicted because the memory is full and it’s not recently used (LRU)
  • You set an item time-to-live (or TTL)
31
Q

Whats a good usage for TTL?

A
  • Leaderboards
  • Comments
  • Activity streams
32
Q

Whats the range for TTL?

A
  • TTL can range from few seconds to hours or days
33
Q

How to manage to many eviction?

A
  • If too many evictions happen due to memory, you should scale up or out
34
Q

What is Amazon Memory DB for Redis?

A
  • Redis-compatible, durable, in-memory database service