AWS DynamoDB Interview Questions and Answers
Freshers / Beginner level questions & answers
Ques 1. What is DynamoDB?
DynamoDB is a fully managed NoSQL database service provided by AWS.
Ques 2. Explain the key-value model in DynamoDB.
DynamoDB uses a key-value model where each item (record) in the database is uniquely identified by a primary key.
Ques 3. Explain the concept of DynamoDB Local.
DynamoDB Local is a downloadable version of DynamoDB that enables local development and testing. It allows developers to test applications without incurring AWS costs.
Ques 4. What is the purpose of the 'DeleteItem' operation in DynamoDB?
The 'DeleteItem' operation removes one or more items from a table based on their primary key. It is used to delete specific items from a table.
Ques 5. What is the purpose of the 'CreateTable' operation in DynamoDB?
The 'CreateTable' operation is used to create a new table in DynamoDB. It involves specifying the table name, primary key attributes, and provisioned throughput settings.
Ques 6. What is the purpose of the 'DescribeTable' operation in DynamoDB?
The 'DescribeTable' operation provides metadata about a table, including its schema, provisioned throughput settings, and the status of any secondary indexes.
Ques 7. Explain the concept of Capacity Units in DynamoDB.
Capacity Units represent the throughput that a table can handle. Read Capacity Units (RCUs) and Write Capacity Units (WCUs) determine the amount of read and write operations a table can support.
Ques 8. What is the purpose of the 'ListTables' operation in DynamoDB?
'ListTables' provides a list of all the tables in a given AWS account and region. It does not require the use of the table's primary key.
Ques 9. Explain the concept of the 'PutItem' operation in DynamoDB.
'PutItem' creates a new item or replaces an existing item with a new one. It adds an item to the table if it does not exist, or replaces the existing item if it does.
Ques 10. What is the purpose of the 'DeleteTable' operation in DynamoDB?
'DeleteTable' is used to delete an existing table and all of its data permanently. Once deleted, a table cannot be recovered.
Ques 11. Explain the concept of the 'GetItem' operation in DynamoDB.
'GetItem' retrieves a single item from a table based on its primary key. It is used to read a specific item from the table.
Intermediate / 1 to 5 years experienced level questions & answers
Ques 12. 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 13. 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 14. 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 15. 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 16. 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 17. 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 18. 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 19. 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 20. 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 21. 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 22. 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 23. 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 24. 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 25. 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 26. 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 27. 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 28. 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 29. 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 30. 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 31. 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 32. 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 33. 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 34. 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 35. 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.
Experienced / Expert level questions & answers
Ques 36. Explain the concept of Global Secondary Index (GSI) in DynamoDB.
A Global Secondary Index allows querying a table based on alternate keys in addition to the primary key. It provides more flexibility in querying data.
Ques 37. What is the difference between On-Demand and Provisioned Throughput in DynamoDB?
On-Demand Throughput allows you to pay per request without capacity planning, while Provisioned Throughput requires capacity planning and offers cost savings for consistent workloads.
Ques 38. Explain the best practices for designing tables in DynamoDB.
Best practices include choosing the right primary key, using appropriate read and write capacities, avoiding hot keys, and utilizing secondary indexes judiciously.
Ques 39. What is the purpose of the DynamoDB Accelerator (DAX)?
DAX is an in-memory caching service that provides fast read access to frequently accessed data in DynamoDB, reducing the need to read from the DynamoDB table directly.
Ques 40. Explain the concept of Provisioned Concurrency in DynamoDB.
Provisioned Concurrency is a feature that ensures that a specified number of read and write capacity units are always available for your table, reducing warm-up times.
Ques 41. Explain the concept of Auto Scaling in DynamoDB.
Auto Scaling automatically adjusts the provisioned read and write capacity based on the actual usage of a table. It helps in handling varying workloads.
Ques 42. What are the limitations of DynamoDB?
Limitations include a maximum item size of 400 KB, a maximum of 256 tables per region per account, and a maximum provisioned capacity of 40,000 read and write capacity units.
Ques 43. Explain the differences between DynamoDB and Amazon RDS.
DynamoDB is a NoSQL database service, while Amazon RDS is a relational database service. DynamoDB is designed for scalability and high availability, while RDS offers traditional relational database features.
Ques 44. What is the purpose of the 'TransactWriteItems' operation in DynamoDB?
'TransactWriteItems' allows you to perform multiple write operations as a single, atomic transaction. Either all the operations in the transaction succeed, or none of them are applied.
Ques 45. Explain the benefits of using DynamoDB Accelerator (DAX).
DAX provides low-latency read access to DynamoDB tables by caching frequently accessed data. It reduces the need to read from the DynamoDB table directly, improving application performance.
Ques 46. How does DynamoDB handle transactions?
DynamoDB supports transactions using the 'TransactWriteItems' operation. It allows you to group multiple write operations into a single, atomic transaction.
Most helpful rated by users:
- What is DynamoDB?
- Explain the concept of the 'GetItem' operation in DynamoDB.
- How does DynamoDB handle transactions?