Databases (DynamoDb, RDS) Flashcards

1
Q

What type of DB is Dynamo Db

A

No SQL db

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

What are key features of Dynamo DB

A

DNAMO
- Distributed across multiple servers
- NoSQL (semi structured / unstructured data)
- Adapts provisioning (on demand or provisioned capacity)
- Managed Service (hardware, config, scaling, backup etc)
- Out of the box encryption (in transit and at rest)

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

What are key value pairs in Dynamo DB

A

data structure used to store and retrieve data

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

What is a sort key in Dynamo Db

A

organizes and orders items within the partition of a table (like a label / category)

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

Which has better performance scanning or querying Dynamo db

A

Query has better performance than scanning

Querying can be efficient with partition key and sort key

Scanning should be avoided because it is slow and more expensive

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

When would you use provisioned Dynamo DB vs on demand Dynamo DB

A

Provisioned is for predictable workloads with known read and write patterns

On demand capacity is for flexible, pay as you go pricing without the need to forecast usage

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

How do we provision and pay for a Dynamo Db table?

A
  1. Provisioned Dynamo DB table
    - Expect 1 read per second can scale up or down by 2
  2. On demand Dynamo DB table
    - spins up, answers request and turns off
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe a real life use case for Dynamo DB

A

Netflix uses DynamoDB to manage customer meta data, preferences and session info because of its scalability, low latency, and high availability

  • Ability to handle massive volumes of data is well-suited to the dynamic and high demand of Netflix
  • Flexible data storage and retrieval of various types of customer data enables personalization and customization of user experiences.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is RDS

A

Is the service that RUNS the database engine ie., oracle, sql

RDS is the database admin

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

What is Aurora?

A

Aurora is a db engine that can be managed with RDS

It is cloud native

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

Why would you want a Aurora Single Master

A

If you have a simple app that doesn’t need complex data distribution or multiple masters

It has ONE ‘master’ database that handles all read and write requests

It’s like a central librarian managing all books and can make changes to them

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

Why would you want Aurora Multi Master

A

If you have a globally distributed or highly responsive app

You will have multiple ‘masters’ capable of reading and writing at the same time

It’s like having multiple librarians who can check out and update books independently

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

Why do you need Aurora Multiple Read Replicas

A

create copies of your database for reading data, making ur app faster because you serve customers in different locations

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

Why would you need Aurora Serverless

A
  • pay as you go
  • auto scales based on demand

ideal for unpredictable apps

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

Where does elasticache fit in the architecture?

A

Elasticache sits between apps and dbs

ie., ec2 elasticache rds

It is a managed service you can used with caching engines such as REDIS or MEMCACHED

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

Name the 2 main types of keys used in Dynamo DB

A

Partition Key (Hash Key)
Sort Key (Range Key)

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

Elasticache is a managed service that you can use with which 2 caching engines..

A

REDIS
MEMCACHED

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
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
19
Q

Why is RDS useful?

A

RDS makes it easier for users to run, manage and scale relational databases without the overhead of traditional database administration tasks

20
Q

How do you identify and analyze slow performing SQL queries in your RDS database?

A

Enable slow log query feature

21
Q

What does TDE stand for?

A

Transparent Data Encryption

22
Q

What do you use Transparent Data Encryption (TDE) for?

A

Use Tranparent Data Encryption (TDE) to encrypt data at rest which protects the data

23
Q

What is Systems Manager param store used for?

A

secure way to store and manage configuration data, secrets and other params

24
Q

What is Systems Manager param store used for in RDS?

A

securley manages and stores configuration data and secrets

such as database credentials and other sensitive information, that can be securely retrieved by applications

25
Q

What is Systems Manager param store used for?

A

Systems Manager param store allows you to securely store and manage configuration data, secrets and other params

26
Q

Name the RDS database engine that was created by AWS and is entirely cloud native?

A

Aurora

27
Q

Name the RDS storage that is a good option for a broad range of use cases such as providing single-digit millisecond latencies and cost-effective storage

A

General-purpose SSD

28
Q

Which has more ElastiCache features. Redis or Memcached?

A

Redis has more features than Memcached

29
Q

What is a projection expression?

A

It is a String that identifies the attributes you want when you perform a getItem, query or scan to read data from a table

Example:
aws dynamodb get-item \
–table-name ProductCatalog \
–key file://key.json \
–projection-expression “Description, RelatedItems[0], ProductReviews.FiveStar”

This projection expression retrieves a top-level scalar attribute (Description), the first element in a list (RelatedItems[0]), and a list nested within a map (ProductReviews.FiveStar).

30
Q

When do you use Redis Elasticache vs Dynamo DB Accelerator (DAX)?

A

Use Redis Elasticache when you need flexible data storage and advanced caching needs such as data manipulation

Use DAX for improved read performance and reduced DynamoDB read traffic.

31
Q

What is a global secondary index in dynamo db?

A

a global secondary index allows you to query the table using alternate attributes as partition keys and sort keys which improves query performance

32
Q

There is an e-commerce platform where the primary table stores information about products, including attributes such as ProductID (primary key), Name, Price, Category, and Availability.

You want to be able to quickly query products from a given category

What could you add to implement this?

A

Add a global secondary index on the Category column

Ie.,
aws dynamodb update-table \
..
..
–global-secondary-index-updates \
“[{
"Create": {
"IndexName": "YourGSIName",
….

33
Q

What is a partition key in dynamo db?

A

you specify the partition key attribute to distribute data evenly across partitions

It acts as input to the hash function, determining the partition where the item will be stored

34
Q

What are global tables in dynamo db?

A

allow you to create tables that are automatically replicated across multiple AWS Regions, providing a highly available and durable solution for globally distributed applications

low-latency access to data for your globally distributed application, with high availability and disaster recovery capabilities.

Global Tables help you maintain data consistency across different regions and provide a reliable and scalable solution for applications that require global data access without compromising on performance or availability.

35
Q

Give 3 examples of when you might want to change the read capacity in dynamo db?

A

to manage fluctuating traffic patterns
optimize performance
reduce costs

36
Q

Why would your Dynamo DB app throw a Throttling error?

A

the provisioned throughput capacity for a table or an index is exceeded

37
Q

What is write around cache using Dynamo DB DAX what is the benefit?

A

directly writes data to DynamoDB so cache data is always up to date

38
Q

What is write through cache using Dynamo DB DAX and what is the benefit

A

Write-through cache with DynamoDB DAX writes data to the cache first, improving read performance by making frequently accessed data readily available.

39
Q

What is use side cache using redis along with Dynamo DB and the benefit

A

Using Redis as a side cache with DynamoDB involves storing frequently accessed data in Redis for faster retrieval, leading to improved application performance and reduced latency.

40
Q

What is write through cache using Redis along with Dynamo DB and its benefit

A

Write-through cache with Redis and DynamoDB means writing data to Redis first and then to DynamoDB, leading to improved read performance as frequently accessed data is readily available in both the cache and the primary data store.

41
Q

what does it mean to use global secondary index with projected attributes in aws?

A

allows you to specify which attributes from the main table should be copied to the index.

42
Q

Is separating the Lambda handler from the core logic is generally considered a best practice

A

Yes

43
Q

What happens if you enable dynamo db triggers?

A

you are configuring your DynamoDB table to automatically invoke a specified AWS Lambda function or an Amazon Kinesis Data Stream when certain events occur on the table. These events are typically changes to the data within the table, such as inserts, updates, or deletions

44
Q

What happens if you enable dynamo db streams?

A

Enabling DynamoDB Streams allows you to capture and track changes to items in a DynamoDB table in real time. You can use this feature to trigger actions, process data, and integrate with other AWS services, creating powerful, event-driven applications.

45
Q

What would you use to schedule a Lambda function to run on a regular basis?

A

WS CloudWatch Events or AWS EventBridge to create a scheduled event that triggers the Lambda function

46
Q

Name the 2 types of Dynamo DB read operations?

A

eventually consistent reads
strongly consistent reads

47
Q

When do you use strongly consistent reads instead of eventually consistent reads

A

Use strongly consistent reads in DynamoDB when you need the most recent data for critical operations

Use eventually consistent reads when slightly outdated data is acceptable for non-critical operations