RDS, Aurora & ElastiCache Flashcards

1
Q

What relational databases does AWS support in the cloud?

A

Postgres, MySQL, MariaDB, Oracle, Microsoft SQL Server, Aurora

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

What does RDS stand for?

A

Relational Database Service

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

What is the advantage of using RDS versus deploying DB on EC2?

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 Disaster Recovery (DR)
  • Maintenance windows for upgrades
  • Scaling capability (vertical and horizontal)
  • Storage backed by EBS (gp2 or io1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the disadvantage of using RDS versus deploying DB on EC2?

A

Cannot SSH into your RDS instances.

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

What is Storage Auto Scaling?

A

RDS detects you are running out of free database storage and scales automatically according to your pre-determined Maximum Storage Threshold.

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

What are the conditions for Storage Auto Scaling to occur?

A

Storage will automatically scale if:
- Free storage is less than 10% of allocated storage
- Low-storage lasts at least 5 minutes
- 6 hours have passed since last modification

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

When is Storage Auto Scaling useful?

A

For applications with unpredictable workloads

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

What is an RDS Read Replica?

A

An instance replication of the main RDS DB instance that only allows reads.

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

What are some advantages of using Read Replicas?

A
  • Allows the ability to scale the read capacity of the RDS DB instance
  • Can scale the read capacity within AZ, Cross AZ or Cross Region
  • Read replicas can be promoted to their own DB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some disadvantages of using Read Replicas?

A
  • Replication is async, and so reads are eventually consistent
  • Main application must update the connection string to leverage read replicas
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a use case for read replicas?

A

Run reporting on an application to run some analytics without affecting production database load
- Create a Read Replica to run the new workload

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

State the main network cost considerations for RDS Read Replicas

A

(Typically there is a network cost when data goes from one AZ to another)
- If a Read Replica is within the same region as the main DB instance, there is no fee
- If the Read Replica is in a different region, you must pay for the cross-region async replication

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

Describe RDS Multi AZ - Disaster Recovery

A
  • Sync replications
  • One DNS name - automatic app failover to standby db instance
  • Standby db instance cannot by read/written to, just there for failover
  • Increase availability
  • No manual intervention in apps
  • Not used for scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When does Multi AZ (Disaster Recovery) occur?

A

RDS will failover in the case of loss of AZ, loss of network, instance or storage failure

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

Is there a possibility to have Read Replicas as Multi AZ for Disaster Recovery?

A

Yes, yes there is

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

Describe the transition of RDS from single to multi AZ

A
  • Zero downtime operation (no need to stop DB)
  • Click ‘modify’ for the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does RDS achieve zero downtime for transition from single-AZ to multi-AZ?

A
  • RDS takes a snapshot of the DB automatically which will then be restored to the standby DB.
  • Synchronization is established between the two databases to allow standby DB to catchup.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is Multi-AZ deployment?

A

Specifies if the DB instance should have a standby deployed in another availability zone.

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

What Structured Languages does Aurora support?

A

Postgres and MySQL

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

What are the advantages of using Aurora?

A
  • Shared Storage Volume automatically grows in increments of 10GB up to 128TB
  • Can have 15 read replicas, with a faster replication process (sub 10ms replica lag)
  • Failover in Aurora is instantaneous (High Availability native)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a possible downside of using Aurora?

A
  • Proprietary technology from AWS (not open sourced)
  • 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
22
Q

How does Aurora offer high availability and read scaling?

A
  • 6 copies of data across 3 AZ
  • 4 out of 6 needed for writes
  • 3 out of 6 needed for reads
  • Self healing with peer-to-peer replication
  • Storage is striped across 100s of volumes
23
Q

Describe the Aurora instance structure and failover contigency

A
  • One Aurora Instance takes writes (master)
  • Automated failover for master in less than 30 seconds
  • Master + up to 15 read replicas serve reads
  • Support for Cross Region Replication
23
Q

Describe the Aurora instance structure and failover contigency

A
  • One Aurora Instance takes writes (master)
  • Automated failover for master in less than 30 seconds
  • Master + up to 15 auto-scaling read replicas serve reads
  • Support for Cross Region Replication
24
Q

Describe the Aurora instance structure and failover contigency

A
  • One Aurora Instance takes writes (master)
  • Automated failover for master in less than 30 seconds
  • Master + up to 15 read replicas serve reads
  • Support for Cross Region Replication
25
Q

Describe the Aurora DB Cluster structure

A
  • A single Writer Endpoint which points to the master instance
  • A single Reader Endpoint at which Connection Load Balancing occurs
  • All read replicas point towards the Reader Endpoint so that the application does not have to manage changing connections due to auto-scaling
26
Q

List the key features of auroras

A
  • Automatic failover
  • Backup and recovery
  • Isolation and security
  • Industry compliance
  • Push button scaling
  • Automated patching with zero downtime
  • Advanced monitoring
  • Routing maintenance
  • Backtrack: restore data at any point of time without using backups
27
Q

What types of encryption does RDS and Aurora offer?

A

At-rest and in-flight encryption

28
Q

Describe At-rest encryption

A
  • Database master and replicas encryption using AWS KMS (must be defined at launch time)
  • If mater not encrypted, the replicas cannot be encrypted
  • To encrypt an un-encrypted database, go through a DB snapshot and restore as encrypted
29
Q

Describe In-Flight encryption

A

TLS-ready by default, use the AWS TLS root certificates client-side

30
Q

How is connection and access to RDS and Aurora managed by AWS?

A
  • IAM authentication: IAM roles to connect to your database (instead of username/pw)
  • Security groups: Control network access to your db
31
Q

Where is SSH access to RDS available?

A

Only if using RDS Custom

32
Q

How would you retain and analyse your DB queries for RDS?

A

Audit Logs can be enabled and sent to CloudWatch Logs

33
Q

What is a difficulty with using AWS ElastiCache?

A

Involves heavy application code changes for use (query cache before/after querying db)

34
Q

What are two ElastiCache architectures?

A
  • DB cache: standard hit/miss strategy to keep most current data available in the in-memory cache (requires invalidation strategy for out of date data)
  • User Session Store: User logs in to application, causing session data to be written to cache; user hits another instance of application which retrieves the session data from the cache
35
Q

Describe Redis

A
  • Multi AZ with Auto-Failover
  • Read replicas to scale reads and have high availability
  • Data Durability using AOF (append only file - log of all write commands that can be re-run to restore state) persistence
  • Backup and restore features
36
Q

Describe Memcached

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

Describe the high-level difference of Redis vs Memcached

A

Redis is high availability with data persistence; memcached is not high availability with no backup but is distributed.

38
Q

What is a risk of caching data?

A

Data may be out of date, eventually consistentWhat is a pattern for effective cahhing

39
Q

What is a risk of caching data?

A

Data may be out of date, eventually consistent

40
Q

What is a pattern where caching would be effective?

A

Slow changing data, few keys are frequently needed

41
Q

What is an anti-pattern where caching would be ineffective?

A

Data changing rapidly, all large key space frequently needed

42
Q

What are some examples of data structured well for caching?

A

Key value caching, or caching or aggregations results

43
Q

Describe Lazy Loading, giving its other names

A

Cache-Aside/Lazy Population: Hit and miss caching

44
Q

What are the pros of Lazy Loading?

A
  • Only requested data is cached (so cache not filled with unused data)
  • Node failures are not fatal, just increase latency to warm the cache
45
Q

What are the cons of Lazy Loading?

A
  • Cache miss penalty of 3 round trips causing a significant delay for the request
  • Stale data: data can be updated in the database and outdated in the cache
46
Q

Describe Write Through

A

Add or Update cache when database is updated

47
Q

What are the pros of Write Through?

A
  • Data in cache is never stale
  • Reads are quick
  • Write penalty instead of read penalty (2 calls per write) (this penalty is more expected from a user)
48
Q

What are the cons of Write Through?

A
  • Missing data until it is added/updated in the DB (can be mitigated by implementing lazy loading as well)
  • Cache churn: a lot of the data will never be read (may be a problem if your cache is very small)
49
Q

Describe three methods of Cache eviction

A
  • Explicit deletion of an item from the cache
  • Item is evicted because memory is full and it’s not recently used (LRU - least recently used)
  • You set an item time-to-live (TTL)
50
Q

When should you consider updating your cache size?

A

Too many evictions due to full cache memory

51
Q

Describe ElastiCache Replication: Cluster Mode Disabled

A
  • One primary node, up to 5 replicas
  • Async replication
  • Primary node is read/write, replicas are read-only
  • One shard, all nodes have all data (guard against data loss if node failure)
  • Multi-AZ enabled by default for failover
52
Q

Describe ElastiCache Replication: Cluster Mode Enabled

A
  • Data is partitioned across shards (helpful to scale writes)
  • Each shard has a primary and up to 5 replicas
  • Multi-AZ enabled by default for failover
  • Up to 500 nodes per cluster (e.g. 500 shards with a single master, 250 shards with 1 master and 1 replica, 83 shards with one master and 5 replicas etc.)