Database Flashcards

1
Q

What is Aurora?

A

Amazon Aurora is a relational database management system (RDBMS) built for the cloud with full MySQL and PostgreSQL compatibility. Amazon Aurora provides built-in security, continuous backups, serverless compute, up to 15 read replicas, automated multi-Region replication, and integrations with other AWS services.

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

True/False. Amazon Aurora utilizes clusters where the architecture consists of a single primary instance along with 0 or more replicas.

A

True.

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

How are Aurora replicas helpful?

A

Aurora replicas can help with both availability and read operations at the same time.

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

What storage does Aurora use?

A

Aurora doesn’t use local storage, it uses cluster volumes for storage. This results in faster provisioning, as well as improved availability and performance.

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

Benefits of Aurora over RDS?

A

Aurora replicas can help with both availability and read operations at the same time. The storage system used in Aurora is more resilient than the one found in typical RDS instances.

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

True/False. Aurora does not have a free-tier option.

A

False. There is no free-tier option. Aurora tends to be a better value than RDS, though there are some exceptions.

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

How is Aurora billed?

A

It is billed based on what’s used. Compute resources are charged hourly based on how many seconds of computing power were used, and the minimum charge is 10 minutes. Storage costs are determined by how many GB were consumed that month as well as an I/O cost per request.

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

How do backups work in Aurora?

A

Backups in Aurora work in mostly the same way as RDS. Restores are used to create a new cluster.

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

What is the feature called ‘Backtrack’ used for in Aurora?

A

If enabled, a feature called ‘Backtrack’ can be used which allows in-place rewinds to a previous point in time. This means that if our data gets corrupted we can fix this issue without having to restore to a new cluster and reconfigure our DB endpoints.

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

What is the feature called ‘Fast Clones’ used for in Aurora?

A

‘Fast clones’ can be used to make a new database much faster than a traditional DB copy.

The way this feature works is that instead of copying all the data, the fast clone references the original DB and simply writes the differences between itself and the original DB, as well as the the differences between the current state of the original DB vs the state of the original DB at the moment it was cloned.

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

What is Amazon Aurora Serverless?

A

Amazon Aurora Serverless is an on-demand, autoscaling configuration for Amazon Aurora. It automatically starts up, shuts down, and scales capacity up or down based on your application’s needs.

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

How does Aurora Serverless scale?

A

Aurora Serverless is scalable via Aurora Capacity Units (ACUs). You can set a minimum and maximum number of ACUs for your cluster and Aurora will scale between them based on load.

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

True/False. An Aurora Serverless cluster can even go to 0 and be paused.

A

True.

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

What resilience does Aurora and Aurora Serverless offer?

A

Aurora Serverless offers the same resilience as Aurora Provisioned (6 copies across AZs).

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

How does Aurora Serverless billed?

A

Aurora Serverless operates on consumption billing on a per-second basis.

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

What scenario is Aurora Serverless good for?

A

Overall, Aurora Serverless is great for infrequently used applications, new applications (where we may not be able to predict their average and peak workloads), variable workloads, unpredictable workloads, development/test databases, and multi-tenant applications.

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

What is DynamoDB?

A

Amazon DynamoDB is a fully managed, serverless, key-value NoSQL database designed to run high-performance applications at any scale. DynamoDB offers built-in security, continuous backups, automated multi-Region replication, in-memory caching, and data import and export tools.

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

What are On-Demand Backups with DynamoDB?

A

With On-Demand backups, backups are performed manually and full backup copies of the table are retained until we manually remove them.

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

What is Point-In-Time-Recovery on a DynamoDB table?

A

If we enable Point-in-time Recovery (PITR) on a table, a continuous record of changes allows us to create a new DynamoDB table using the data from any point in the 35 day recovery window.

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

What consistency modes are available in read operations for DynamoDB?

A

Eventually Consistent or Strongly/Immediately Consistent.

Eventual consistency is easier to implement and scales better, but immediate consistency is required for some applications/operations.

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

What are Eventually Consistent Reads in DynamoDB?

A

Eventually consistent is the default read consistent model for all read operations. When issuing eventually consistent reads to a DynamoDB table or an index, the responses may not reflect the results of a recently completed write operation. If you repeat your read request after a short time, the response should return the more recent item.

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

What are Strongly Consistent Reads in DynamoDB?

A

Read operations such as GetItem, Query, and Scan provide an optional ConsistentRead parameter. If you set ConsistentRead to true, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful.

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

What is DynamoDB Accelerator (DAX)?

A

DynamoDB Accelerator (DAX) is an in-memory cache designed specifically for DynamoDB.

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

What are DynamoDB Global Tables?

A

Global tables provide you 99.999% availability, increased application resiliency, and improved business continuity. As global tables replicate your Amazon DynamoDB tables automatically across your choice of AWS Regions, you can achieve fast, local read and write performance.

Global tables provide multi-master cross-region replication.

Global tables resolve conflicts on a ‘Last writer wins’ basis.

Global tables can be useful for improving performance, providing global high availability, and/or for global disaster recovery/business continuity.

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

What are DynamoDB Secondary Indexes?

A

Secondary indexes allow for an alternative presentation of data stored in a base table.

26
Q

What are DynamoDB Local Secondary Indexes (LSIs)?

A

Local Secondary Indexes (LSIs) must be created with a table, and provide an alternative sort key for the data in the table.

27
Q

What are DynamoDB Global Secondary Indexes (GSIs)?

A

Global Secondary Indexes (GSIs) can be created at any time. They allow for defining an alternative partition key and an alternative sort key.

28
Q

True/False. AWS recommends using LSIs by default, and only using GSIs when strong consistency is required.

A

False. AWS recommends using GSIs by default, and only using LSIs when strong consistency is required.

29
Q

What are DynamoDB Streams?

A

DynamoDB Streams are a 24 hour rolling window of time ordered changes to items in a DynamoDB table.

30
Q

How are DynamoDB Streams enabled?

A

Streams are enabled on a per table basis, and record any INSERTS, UPDATES, and DELETES.

31
Q

What happens when an item is changed in DynamoDB Streams?

A

When items change, an event is generated and that event contains the data which changed. An action can then be taken using that data.

32
Q

True/False. This type of architecture is called a ‘Trigger’ and it can be implemented using DynamoDB Streams along with Lambda.

A

True.

33
Q

What is DynamoDB Time to Live (TTL)?

A

DynamoDB Time to Live (TTL) allows us to define a per-item timestamp to determine when an item is no longer needed. Shortly after said time has passed, DynamoDB will delete the item from our table without consuming any write throughput. TTL is provided at no extra cost as a means to reduce stored data volumes by retaining only the items that remain current for our workload’s needs.

34
Q

What is a DynamoDB Table?

A

A table is a grouping of items that share the same primary key.

35
Q

True/False. Items within a table can be a maximum of 500kb.

A

False. Items within a table can be a maximum of 400kb.

36
Q

What is RDS?

A

Amazon Relational Database Service (Amazon RDS) is a collection of managed services that makes it simple to set up, operate, and scale databases in the cloud. Choose from seven popular engines — Amazon Aurora with MySQL compatibility, Amazon Aurora with PostgreSQL compatibility, MySQL, MariaDB, PostgreSQL, Oracle, and SQL Server — and deploy on-premises with Amazon RDS on AWS Outposts.

37
Q

How are RDS backups and snapshots made? Where are they stored?

A

Both automated backups and snapshots use AWS Managed S3 Buckets for storage. The benefit of using S3 for storage is that the data being stored becomes regionally-resilient.

38
Q

True/False. RDS DBs can be backed up either automatically or manually and RDS DB snapshots can be performed either manually or automatically..

A

True.

39
Q

True/False. Both automated backups and snapshots are taken of the RDS instance, which does not include all of the databases within it.

A

False. Both automated backups and snapshots are taken of the RDS instance, which means all of the databases within it.

40
Q

True/False. RDS Snapshots remain even after we delete an RDS instance. They’re only deleted if we delete them manually or via some other external process.

A

True.

41
Q

How often do RDS automated backups occur

A

Automated backups occur once per day, and can occur at a time of our choosing or a time chosen randomly by AWS./

42
Q

What is the retention period for RDS backups?

A

Automated backups can be retained from 0 days to 35 days. If retention is set to 0 days, automated backups will be disabled.

43
Q

True/False. RDS can be configured to replicate backups to another region (both snapshots and transaction logs). Charges apply for both the cross-region data copy as well as the storage in the destination region.

A

True.

44
Q

Can RDS backups be restored?

A

Backups can be restored, but it’s important to note that restores aren’t fast. For that reason, restore time is something that needs to be considered when recovery time objective (RTO) planning.

45
Q

True/False. RDS is a managed service, which means that when using it we generally have any access to the OS or SSH.

A

False. RDS is a managed service, which means that when using it we generally DON’T have any access to the OS or SSH.

46
Q

Can RDS instances have multiple databases?

A

RDS instances can have multiple databases. Every RDS instance has its own dedicated storage provides by EBS.

47
Q

What factors influence the cost of RDS?

A
  1. The instance size & type (billed per second).
  2. Whether multiple AZs are used or not.
  3. The amount of data transferred in and out of the instance.
  4. The amount of backup/snapshot storage.
  5. Any applicable licensing costs.
48
Q

What is Relational Database Service (RDS) Proxy?

A
  1. It’s a fully managed DB Proxy for RDS/Aurora.
  2. It auto scales, and is highly available by default.
  3. It provides connection pooling — reducing DB load in the process.
  4. RDS Proxy is only accessible from a VPC or VPC-connected networks.
  5. RDS Proxy is accessed via a Proxy endpoint.
  6. It can enforce SSL/TLS connections.
  7. It can reduce failover time by over 60%.
  8. It can abstract failure away from our application.
49
Q

Is SSL/TLS available for RDS?

A

SSL/TLS is available for RDS, and can even be made mandatory.

50
Q

What all is encrypted with an encrypted RDS DB instance?

A

For an Amazon RDS encrypted DB instance, all logs, backups, and snapshots are encrypted. RDS uses an AWS KMS key to encrypt these resources.

51
Q

How must RDS encrypted read replicas be encrypted?

A

A read replica of an RDS encrypted instance must be encrypted using the same KMS key as the primary DB instance if both are in the same AWS region.

If they are in different AWS regions, the read replica would be encrypted using the KMS key for that AWS region.

52
Q

True/False. It’s important to note that encryption can be removed from an RDS instance once it has been encrypted.

A

False. It’s important to note that encryption CANNOT be removed from an RDS instance once it has been encrypted.

53
Q

If using RDS with Oracle or SQL Server, is Transparent Data Encryption (TDE) is supported?

A

Yes.

54
Q

What is Database Migration Service (DMS)?

A

DMS is a managed database migration and replication service for moving databases both into and out of AWS quickly, securely, with minimal downtime, and with zero data loss.

55
Q

What does DMS support?

A

DMS supports MySQL, Aurora, Microsoft SQL, MariaDB, MongoDB, PostgreSQL, Oracle, Azure SQL, etc.

56
Q

True/False. When using DMS, at least one of the two databases (source and/or target) must be within AWS.

A

True.

57
Q

What is Schema Conversion Tool (SCT) in DMS?

A

SCT is used when converting one database engine to another. SCT is NOT used when migrating between databases of the same type.

58
Q

What are consistency, availability, and partition tolerance in data transaction models?

A

Consistency — Every read receives the most recent write or an error.
Availability — Every request receives a (non-error) response, without the guarantee that it contains the most recent write.
Partition Tolerance — The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes.

59
Q

What transaction model does RDS utilize?

A

A product/service like RSD utilizes the ACID transaction model. While very reliable, this model limits scaling.

60
Q

What does ACID stand for?

A
  1. Atomic — ALL or NO components of a transaction SUCCEED or FAIL.
  2. Consistent — Transactions move the database from one valid state to another — nothing in-between is allowed.
  3. Isolated — If multiple transactions occur at once, they don’t interfere with each other. Each executes as if it’s the only one.
  4. Durable — Once committed, transactions are durable. This means that they are stored on non-volatile memory, and are resistant to power outages or crashes.
61
Q

What transaction model does DynamoDB utilize?

A

A product/service like DynamoDB utilizes the BASE transaction model. While somewhat less reliable, this model promotes excellent performance and scaling capabilities.

62
Q

What is the BASE transaction model?

A
  1. Basically Available — READ and WRITE operations are available ‘as much as possible’ but without any consistency guarantees.
  2. Soft State — The database doesn’t enforce consistency, this is offloaded onto 3. Eventually Consistent — If we wait long enough, reads from the system will be consistent.