AWS DynamoDB Interview Questions and Answers
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. What are the two types of primary keys in DynamoDB?
DynamoDB supports two types of primary keys: partition key and composite key (partition key + sort key).
Ques 2. What is the importance of Provisioned Throughput in DynamoDB?
Provisioned Throughput is the capacity (read and write) reserved for a table. It ensures predictable performance.
Ques 3. Explain the differences between DynamoDB and traditional relational databases.
DynamoDB is a NoSQL database with a flexible schema, automatic scaling, and high availability, while traditional relational databases are SQL-based with a fixed schema.
Ques 4. How does DynamoDB achieve scalability and high availability?
DynamoDB achieves scalability and high availability through partitioning, replication, and automatic sharding of data across multiple servers.
Ques 5. What is the significance of the 'Consistent Read' option in DynamoDB?
Consistent Read ensures that a read operation returns the most up-to-date data reflecting all writes that are acknowledged before the read.
Ques 6. What is the Local Secondary Index (LSI) in DynamoDB?
A Local Secondary Index is an index that has the same partition key as the base table but a different sort key. It allows efficient querying of data within a single partition.
Ques 7. Explain the concept of Item Collections in DynamoDB.
An Item Collection is a set of items that have the same partition key value in a table with a composite primary key. Collections are formed when a table has a sort key.
Ques 8. How does DynamoDB handle conflicts in write operations?
DynamoDB uses conditional writes and optimistic concurrency control to handle conflicts in write operations. Conditional writes allow you to specify conditions for write operations to succeed.
Ques 9. Explain the concept of Time-to-Live (TTL) in DynamoDB.
TTL is a feature in DynamoDB that allows you to automatically expire items from a table after a specified time. It is useful for managing data that has a limited lifespan.
Ques 10. What is the purpose of the DynamoDB Streams?
DynamoDB Streams capture changes to items in a table, including new items, updates, and deletions. It allows you to process and react to changes in real-time.
Ques 11. How does DynamoDB handle schema changes in a table?
DynamoDB is schema-less, allowing you to add or remove attributes at any time without affecting existing items. Indexes need to be created or modified separately.
Ques 12. What is the significance of the 'Scan' operation in DynamoDB?
The 'Scan' operation in DynamoDB reads every item in a table, making it less efficient than 'Query.' It should be used sparingly and is often used when a table has no defined schema.
Ques 13. How does DynamoDB handle eventual consistency?
DynamoDB provides both eventual and strong consistency. By default, read operations are eventually consistent, but you can request strongly consistent reads when needed.
Ques 14. What is the purpose of the 'BatchGetItem' operation in DynamoDB?
'BatchGetItem' retrieves multiple items from one or more tables using their primary keys. It allows efficient retrieval of multiple items in a single request.
Ques 15. Explain the differences between the 'UpdateItem' and 'PutItem' operations in DynamoDB.
'UpdateItem' modifies existing attributes or adds new ones to an existing item, while 'PutItem' creates a new item or replaces an existing item with a new one.
Ques 16. What is the purpose of the 'Query' operation in DynamoDB?
The 'Query' operation retrieves items from a table using a specified primary key or index key. It is more efficient than 'Scan' for retrieving a subset of items.
Ques 17. Explain the concept of Conditional Writes in DynamoDB.
Conditional Writes allow you to specify conditions that must be satisfied for a write operation to succeed. It helps in avoiding conflicts and ensuring data integrity.
Ques 18. How does DynamoDB handle security and access control?
DynamoDB uses AWS Identity and Access Management (IAM) to control access to tables. You can define fine-grained access policies to control who can perform specific actions.
Ques 19. What is the purpose of the 'BatchWriteItem' operation in DynamoDB?
'BatchWriteItem' writes multiple items to one or more tables using a single request. It is more efficient than making individual 'PutItem' or 'DeleteItem' calls.
Ques 20. Explain the concept of Point-in-Time Recovery (PITR) in DynamoDB.
PITR allows you to restore a table to any point in time within the last 35 days. It helps in recovering from accidental data loss or corruption.
Ques 21. How does DynamoDB handle encryption at rest and in transit?
DynamoDB encrypts data at rest using AWS Key Management Service (KMS) and supports encrypted connections (SSL/TLS) for data in transit.
Ques 22. Explain the concept of the 'UpdateTable' operation in DynamoDB.
'UpdateTable' is used to modify the provisioned throughput settings for a table. It can be used to increase or decrease the capacity of a table.
Ques 23. How does DynamoDB handle backups?
DynamoDB supports on-demand backups and enables Point-in-Time Recovery (PITR). Backups can be used to restore a table to any point in time within the last 35 days.
Ques 24. What is the purpose of the 'BatchGetItem' operation in DynamoDB?
'BatchGetItem' retrieves multiple items from one or more tables using their primary keys. It allows efficient retrieval of multiple items in a single request.
Most helpful rated by users:
- What is DynamoDB?
- Explain the concept of the 'GetItem' operation in DynamoDB.
- How does DynamoDB handle transactions?