Database Flashcards

1
Q

Define DynamoDB.

DynamoDB Flashcards: Core Concepts

A

A fully managed, serverless, key-value NoSQL database offering high performance and scalability for any scale.

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

What are the core components of DynamoDB?

A

Tables, Items, Attributes, and Primary Keys (Partition Key or Partition Key + Sort Key)

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

Explain the function of a DynamoDB Partition Key.

A

Distributes data across partitions, ensuring even distribution and efficient data access. Must be unique for each item.

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

What role does a Sort Key play?

A

Organizes data within a partition, enabling range queries and sorting within a partition.

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

What data types does DynamoDB support?

A

Scalar (String, Number, Binary, Boolean, Null), Document (List, Map), and Set types (String Set, Number Set, Binary Set).

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

Differentiate between Provisioned and On-Demand capacity modes.

A
  • Provisioned: User defines read/write capacity units (RCUs/WCUs). Offers cost predictability.
  • On-Demand: DynamoDB automatically scales capacity. Ideal for unpredictable workloads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the benefits of DynamoDB Streams?

A

Capture item-level modifications (create, update, delete) for real-time reactions, analytics, cross-region replication, and other event-driven architectures.

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

How does DynamoDB Time To Live (TTL) work?

A

Automatically deletes items after a defined time period based on a “Number” attribute containing the Unix Epoch timestamp.

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

How do you write data to DynamoDB?

A

Using PutItem (create or replace), UpdateItem (modify existing), and BatchWriteItem (for multiple items).

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

Explain Conditional Writes in DynamoDB.

A

Allow write operations only if specific conditions are met, preventing unintended overwrites and supporting atomic operations.

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

What are the primary ways to read data from DynamoDB?

A

GetItem (retrieve by primary key), Query (retrieve items based on partition key and optional sort key conditions), Scan (scan the entire table with optional filters).

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

What is the purpose of BatchGetItem?

A

Retrieves multiple items from one or more tables in a single API call, improving efficiency.

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

Compare Eventually Consistent Reads and Strongly Consistent Reads.

A
  • Eventually Consistent: May return stale data due to replication lag. Higher performance, lower cost.
  • Strongly Consistent: Guarantees the latest data. Consumes more RCUs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you delete data in DynamoDB?

A

DeleteItem (delete a single item), BatchWriteItem (delete multiple items), DeleteTable (delete the entire table).

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

What are Local Secondary Indexes (LSIs)?

A

Alternative sort keys for a table, using the same partition key as the base table. Defined at table creation.

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

What are Global Secondary Indexes (GSIs)?

A

Indexes with a different partition key and/or sort key from the base table. Can be created after table creation.

17
Q

What is the impact of throttling on GSIs?

A

If writes to a GSI are throttled, writes to the main table are also affected, even if the main table has sufficient WCUs.

18
Q

How does DynamoDB Accelerator (DAX) improve performance?

A

Provides an in-memory cache for DynamoDB, significantly reducing read latency, especially for frequently accessed data (“hot keys”).

19
Q

What is PartiQL?

A

A SQL-compatible query language for DynamoDB, enabling familiar SQL-like syntax for data operations.

20
Q

Describe the Large Object pattern in DynamoDB.

A

For storing large items (> 400KB), store the data in S3 and metadata in DynamoDB.

21
Q

How can you control access to DynamoDB at a granular level?

A

Use IAM roles with conditions, specifying LeadingKeys (row-level access) and Attributes (attribute-level access).

22
Q

What are DynamoDB Global Tables?

A

Multi-region, multi-active tables that replicate data across AWS regions for high availability and low latency globally.

23
Q

What is Amazon RDS?

A

A managed relational database service supporting popular engines like MySQL, PostgreSQL, Oracle, SQL Server, etc.

24
Q

What are the key benefits of using RDS?

A

Easy setup, operation, and scaling; automated backups; high availability; security features.

25
Q

What is Amazon Aurora?

A

A MySQL and PostgreSQL-compatible relational database designed for the cloud, offering high performance, scalability, and cost-effectiveness.

26
Q

Explain the ACID properties in the context of RDS.

A

Atomicity, Consistency, Isolation, and Durability – guarantees for reliable transaction processing.

27
Q

What are the different types of locks in RDS?

A

Shared locks (allow concurrent reads) and Exclusive locks (prevent all other operations).

28
Q

List some RDS best practices.

A

Monitor with CloudWatch, perform regular backups, test failover, optimize queries with indexes, and use read replicas.

29
Q

How can you optimize query performance in RDS?

A

Use indexes, analyze query plans, avoid full table scans, and use database-specific tuning techniques.

30
Q

What is Amazon DocumentDB?

A

A MongoDB-compatible, document database service offering high scalability and availability.

31
Q

What is Amazon MemoryDB for Redis?

A

A Redis-compatible, in-memory database with data durability, providing ultra-fast performance for caching and real-time applications.

32
Q

What is Amazon Keyspaces (for Apache Cassandra)?

A

A managed service for running Apache Cassandra, a highly scalable and available NoSQL database.

33
Q

What is Amazon Neptune?

A

A fully managed graph database service for applications dealing with highly connected datasets, like social networks and knowledge graphs.

34
Q

What is Amazon Timestream?

A

A serverless time series database optimized for storing and analyzing time-stamped data, commonly used for IoT and operational analytics.