DynamoDB Interview Questions: DynamoDB is a powerful NoSQL database service provided by AWS, and its popularity is on the rise. As more companies move to the cloud, the demand for professionals with DynamoDB skills is also increasing. To ace a DynamoDB technical interview, candidates need to have a strong understanding of the database’s features and capabilities which can be obtained with the help of the provided DynamoDB Technical Interview Questions. In this article, we’ll cover some of the Latest DynamoDB Interview Questions and answers, including those designed for freshers, to help you prepare for your next interview and stand out from the competition. Make use of the DynamoDB Interview Questions for Freshers presented and prepared well.
AWS DynamoDB Interview Questions
Q1. What is DynamoDB?
Q2. What are NoSQL databases?
- What are the key features of DynamoDB?
Q4. What are some benefits of using DynamoDB?
Q5. What are the advantages of using DynamoDB?
Q6. What are the disadvantages of DynamoDB?
Q7. What are the use cases of DynamoDB?
Q8. What is DynamoDBMapper?
Q9. What is meant by Partition Key in DynamoDB?
Q10. How does DynamoDB Query functionality work?
Q11. What are the data types supported by DynamoDB?
Q12. What sort of query functionality is supported by DynamoDB?
Q13. What are the APIs provided by Amazon DynamoDB?
Q14. Why DynamoDB?
Q15. How to access DynamoDB?
Q16. Is DynamoDB free for use?
Q17. How to generate DynamoDB Access Key and Secret Key?
Q18. What is DynamoDBMapper class?
Q19. How does Dynamo DB work?
Q20. How does Dynamo DB prevent data loss?
Q21. What are the two types of primary keys supported by Dynamo DB?
Q22. How is DynamoDB different from other databases?
Q23. List some important methods of Dynamo DB Mapper Class?
Q24. What is the partition key in Dynamo DB?
Q25. What is an index in DynamoDB?
Q26. Are there any limitations to using DynamoDB? If yes, then what are they?
Q27. What are the different ways that data can be accessed in DynamoDB?
Q28. What do you understand about DynamoDB Streams?
Q29. List types of secondary indexes in DynamoDB?
Q30. How many number of global secondary indexes can you create per table?
Q31. What is global secondary indexes in DynamoDB?
Q32. What is local secondary indexes in DynamoDB?
Q33. How does DynamoDB handle data partitioning?
Q34. What is a sort key in DynamoDB?
Q35. What is the maximum size of a DynamoDB item?
Q36. What is the maximum size of a DynamoDB table?
Q37. How does DynamoDB handle query optimization?
Q38. What is a secondary index in DynamoDB?
Q39. What is eventual consistency in DynamoDB?
Q40. What is strong consistency in DynamoDB?
Q41. What is the difference between a DynamoDB table and a DynamoDB stream?
Q42. What is the maximum number of DynamoDB streams allowed per table?
Q43. What is the maximum retention period for a DynamoDB stream?
Q44. What is DynamoDB Accelerator (DAX)?
Q45. What is the purpose of DynamoDB Auto Scaling?
Q46. How does DynamoDB handle data encryption?
Q47. What is the difference between a strongly-typed and a weakly-typed attribute in DynamoDB?
Q48. What is the maximum number of items that can be retrieved in a single DynamoDB query?
Q49. What is the maximum number of tables that can be created in a single AWS account?
Q50. What is the purpose of DynamoDB point-in-time recovery (PITR)?
Q51. What is the difference between a hash key and a range key in DynamoDB?
Q52. What is the difference between a reserved capacity and a provisioned capacity in DynamoDB?
Q53. What is the purpose of the DynamoDB backup feature?
Q54. What is the difference between a table backup and a table export in DynamoDB?
Q55. Is Redis faster than DynamoDB?
Q56. What is DynamoDB Auto Scaling?
Q57. What are API calls supported by a global secondary index?
Q58. How to delete a Global Secondary Index in Amazon DynamoDB?
Q59. Can I delete local secondary indexes?
Q60. What are the key differences between Amazon DynamoDB and Amazon Aurora?
Q61. List 5 ways to fetch data from DynamoDB
Q62. What are DynamoDB Projections?
Q63. How does DynamoDB prevent data loss?
Q64. What are the DynamoDB pricing tiers?
Q65. What is the DynamoDB Local?
Q66. What are DynamoDB Global Tables?
Q67. Explain DynamoDB – Time To Live (TTL).
Q68. Explain DynamoDB Integration with S3.
Q69. What are DynamoDB Global Tables?
Q70. Explain DynamoDB Stream Processing.
Q1. What is DynamoDB?
DynamoDB is a fully managed NoSQL database service. It is backed by AWS and provides exciting features like seamless scalability, fast performance, and high reliability over data. DynamoDB supports both key-value and document data structures. In addition, this service comes with different pricing tiers to suit varying user requirements.
DynamoDB is quite effective at data storing and retrieval in all traffic levels and allows the users to create tables for the database.
Q2. What are NoSQL databases?
NoSQL or non-relational databases focus on different data storing models rather than a tabular structure. There are four types of NoSQL databases:
- Key-value stores
- Document stores
- Graph store
- Colum stores
- DynamoDB supports both document and key-value structures.
Q3. What are the key features of DynamoDB?
- Highly Scalable without any intervention from the user.
- It has a latency of microseconds.
- Serverless and enterprise-ready.
- Encryption at Rest.
- On-demand backup and restore.
- Point-in-time recovery.
Q4. What are some benefits of using DynamoDB?
- Managed service − Amazon DynamoDB is a managed service. There is no need to hire experts to manage NoSQL installation. Developers need not worry about setting up, configuring a distributed database cluster, managing ongoing cluster operations, etc. It handles all the complexities of scaling, partitions and re-partitions data over more machine resources to meet I/O performance requirements.
- Scalable − Amazon DynamoDB is designed to scale. There is no need to worry about predefined limits to the amount of data each table can store. Any amount of data can be stored and retrieved. DynamoDB will spread automatically with the amount of data stored as the table grows.
- Fast − Amazon DynamoDB provides high throughput at very low latency. As datasets grow, latencies remain stable due to the distributed nature of DynamoDB’s data placement and request routing algorithms.
- Durable and highly available − Amazon DynamoDB replicates data over at least 3 different data centers’ results. The system operates and serves data even under various failure conditions.
- Flexible: Amazon DynamoDB allows creation of dynamic tables, i.e. the table can have any number of attributes, including multi-valued attributes.
- Cost-effective: Payment is for what we use without any minimum charges. Its pricing structure is simple and easy to calculate.
Q5. What are the advantages of using DynamoDB?
We can store any amount of data with the unlimited storage provided by the DynamoDB service.
- The data we store replicates over many availability regions. It can easily cope with global-scale applications and make sensitive information highly available.
- It is highly cost-effective, and the users have to pay only for what they use.
- Easy administration and the user doesn’t have to worry about software patching, setup, and configuration because AWS fully manages DynamoDB.
- DynamoDB has an advanced system for reporting and highly secured user authentication mechanisms to provide maximum security over sensitive data.
Q6. What are the disadvantages of DynamoDB?
- No triggers and lack server-side scripts.
- No table joins possible.
- Data querying is highly limited.
- The cost can be unpredictable with spikes in usage.
Q7. What are the use cases of DynamoDB?
- Daily web analytics
- Real-time analytics
- Data warehousing
- Business Intelligence
Q8. What is DynamoDBMapper?
The DynamoDBMapper class is an entry point that allows access to DynamoDB endpoints, enabling users to handle the database. Users can perform CRUD operations, run queries, and scan against tables. And this class is only available for Java.
Q9. What is meant by Partition Key in DynamoDB?
A partition key is a primary key composed of only a single attribute. In DynamoDB, the value of the partition key work as the input for internal hash functions. The resulting output from that function helps determine the partition to store the item in question.
Q10. How does DynamoDB Query functionality work?
DynamoDB provides 2 options to fetch data from collections as Query and Scan. When using Scan, DynamoDB will look through the complete table for records with matching criteria, while Query uses key constraints to perform a direct lookup for a particular data set.
In addition to the primary key, DynamoDB uses global secondary key, local secondary key, and partition primary key to help improve flexibility and improve the read/ write operation speed.
As a result, it is fast and time effective compared to the DynamoDB Scan operation and is recommended for most data fetching scenarios
Q11. What are the data types supported by DynamoDB?
The four scalar data types that DynamoDB supports are as follows:
- Numbers
- Strings
- Binary
- Boolean.
Data types for collections that DynamoDB supports include:
- String Set Number Set
- Heterogeneous Binary Set
- Differentiated Map
- DynamoDB accepts Null values.
Q12. What sort of query functionality is supported by DynamoDB?
GET/PUT operations that use the user-defined unique identifier are supported.
By enabling querying of a non-primary key characteristic using both local and global secondary indexes, it offers flexible querying.
Data for an item linked to a single attribute separation primary key can be read and written quickly.
It enables you to access all the items for a single aggregate partition-sort key along a number of sort keys using the Query API.
Q13. What are the APIs provided by Amazon DynamoDB?
- UpdateTable
- CreateTable
- DescribeTable
- DeleteTable
- PutItem
- ListTables
- UpdateItem
- BatchWriteItem
- GetItem
- Query
- DeleteItem
- Scan
- BatchGetItem.
Q14. Why DynamoDB?
DynamoDB is a NoSQL database service. DynamoDB is designed in such a way that the user can get high-performance, run scalable applications that would not be possible with the traditional database system. Amazon Web Services uses DynamoDB because there are few other reasons why you might consider DynamoDB:
- On-demand capacity mode: The applications using the on-demand service, DynamoDB automatically scales up/down to accommodate the traffic.
- Built-in support for ACID transactions: DynamoDB provides native/ server-side support for transactions.
- On-demand backup: This feature allows you to create a complete backup of your work at any given point of time.
- Point-in-time recovery: These features help you with the protection of your data in case of accidental read/ write operations.
- Encryption at rest: It keeps the data encrypted even when the table is not in use. This enhances security with the help of encryption keys.
- Reliable: Despite a few outages DynamoDB has a proven track of being a rock-solid database solution. Also, all data that is written to DynamoDB is replicated to three different locations.
- Schemaless: As, like many other NoSQL databases DynamoDB does not impose strict schema allowing more flexibility.
- Simple API: DynamoDB API is very straightforward. Overall it has less than twenty methods as only a handful of them are related to writing and reading data.
- AWS services Integration: DynamoDB is one of the core AWS services and has good integration with other services that AWS provides. You can also use it together with CloudSearch to enable full-text search, to perform data analytics with AWS EMR, backup data with AWS Data Pipeline, Processing DynamoDB Data with Apache Hive on Amazon EMR, etc.
Q15. How to access DynamoDB?
If you haven’t already set up an AWS account, choose to Create an AWS Account, and you will be guided through the process of setting one up. Accessing DynamoDB is very easy and can be done using the following methods:
Using Console:
You can access DynamoDB simply by sign in your AWS Account Click on My Account -> AWS Management Console -> Click on Services -> Search for DynamoDB under Database service then click on it -> you will be redirected on Amazon DynamoDB Create Table page.
Using CLI (Command Line Interface):
You can use the AWS Command Line Interface (AWS CLI) to control multiple AWS services from the command line and automate them through scripts. You can use the AWS CLI for this operation, such as creating a table. You can also use it to set DynamoDB operations within utility scripts. Before you can use the AWS CLI with DynamoDB, you must get an Access Key ID and Secret access key.
Using API:
Using AWS SDKs you can make the most of DynamoDB. AWS SDK supports a variety of languages like Java, JavaScript, .NET, Python, PHP, etc.
Before you can use the AWS SDKs with DynamoDB, you must get an AWS Access Key ID and Secret access key.
Q16. Is DynamoDB free for use?
In Amazon DynamoDB you only pay for the resources you provision.
Get started with free tier limits of DynamoDB on which many applications operate.
In need of resources, the pricing per month varies depending on which type of resources you require.
Q17. How to generate DynamoDB Access Key and Secret Key?
Log in to AWS and then go to the security credentials page.
Navigate to Access Keys section then create a new access key by clicking on Create New Access Key.
Click on the Show access key link to see the access key which was created.
Q18. What is DynamoDBMapper class?
The entry point for DynamoDB is the DynamoDBMapper class. It provides access to a DynamoDB endpoint and allows you to access your data from different tables, perform various CRUD operations, and execute queries and scans table.
Q19. How does Dynamo DB work?
Dynamo DB uses B-trees and Hashing techniques to manage data. When you enter data, it is first distributed into different partitions using hashing then the data is stored in a particular partition by initializing it with a key. Each partition can store up to 10GB of data by default and handles 3000 read and 1000 write capacity units. Dynamo DB stores and retrieves information based on partition key values.
To write an item to the table, Dynamo DB uses partition key value and inputs this value to the hash function then the output of this function determines the partition of where to store the item.
Q20. How does Dynamo DB prevent data loss?
To prevent data loss, Dynamo DB uses a two-tier backup system and long-term storage. Each of the partitions contains three nodes, each of which holds a copy of that particular partition’s data. Each node includes two data structures: a B tree used to locate items and a replication log that notes all the changes made to that node. Dynamo DB takes snapshots of these and stores them for a month in another AWS database to efficiently restore the databases.
Q21. What are the two types of primary keys supported by Dynamo DB?
Partition key: Used for hash value to detect storage.
Sort key: Used to detect storage location
Q22. How is DynamoDB different from other databases?
DynamoDB is known as the “Amazon’s footprint in the NoSQL world”. Dynamo database is regarded as one of the best and scalable databases because it has a flexible data model in which the attributes of a row will not match the one in the next row. This database can store key-value pairs and JSON files. The major advantage of having DynamoDB as your database is you don’t have to maintain any servers or handle the traffic. All that you need to do is create tables and start using them.
Q23. List some important methods of Dynamo DB Mapper Class?
Save: Saves a particular object to the table.
Load: Retrieves an item from the table
Delete: It deletes an item from the table
Query: Queries a table or an index
Scan page: Scans a table or index and returns a matched result page.
Parallel scan: Performs a scan of the entire table or index.
Batch save: Saves object to one or more tables.
Q24. What is the partition key in Dynamo DB?
A partition key is simply a primary key with only one attribute. Dynamo DB uses partition key as input to the hash function whose output determines the partition to store the item in the database.
Q25. What is an index in DynamoDB?
DynamoDB allows faster access to items in the database table by providing primary key values. Indexing takes place when you want to fetch the attributes data other than the primary key. An index is a data structure that increases the speed of retrieving the data from the database.
Q26. Are there any limitations to using DynamoDB? If yes, then what are they?
DynamoDB is a powerful tool, but it does have its limitations. One such limitation is that it is not well suited for handling large amounts of data. If you are looking to store a large amount of data, then you may want to consider another solution. Additionally, DynamoDB can be expensive to use, so you will need to weigh the cost of using it against the benefits it provides.
Q27. What are the different ways that data can be accessed in DynamoDB?
Data in DynamoDB can be accessed using the Query or Scan APIs. The Query API allows you to query data using a primary key, while the Scan API allows you to scan data for items that match certain criteria.
Q28. What do you understand about DynamoDB Streams?
DynamoDB Streams is a feature of DynamoDB that allows you to capture data changes in your DynamoDB table in near-real-time. This can be useful for a number of different applications, such as auditing or keeping a second copy of your data in another region for disaster recovery.
Q29. List types of secondary indexes in DynamoDB?
Global Secondary Index: It is an index created with partition or partition sort key that is different from those tables. The global secondary index is considered global as queries on the index can span all the items in the table across all partitions.
Local Secondary Index: An index that has the same partition key as that of table but different sort key. It is considered local as every partition of index is scoped to a table partition that has the same partition key.
Q30. How many global secondary indexes can you create per table?
We can create a maximum of 5 global secondary indexes per table.
Q31. What are global secondary indexes in DynamoDB?
Global secondary indexes are indexes that are created on a DynamoDB table that are not the table’s primary key. Global secondary indexes provide the ability to query data across multiple partitions and to perform data operations that are not possible with a single partition key.
Q32. What are local secondary indexes in DynamoDB?
Local secondary indexes give you the ability to query your DynamoDB data using an alternate sort key, which can be different from the sort key used to store the data in the table. This can be useful if you need to query your data in different ways, or if you want to provide your users with different views of the data.
Q33. How does DynamoDB handle data partitioning?
DynamoDB partitions data automatically across multiple servers using partition keys and sort keys.
Q34. What is a sort key in DynamoDB?
A sort key is a secondary key for a DynamoDB table and is used to sort items within a partition.
Q35. What is the maximum size of a DynamoDB item?
The maximum size of a DynamoDB item is 400 KB.
Q36. What is the maximum size of a DynamoDB table?
The maximum size of a DynamoDB table is 10 GB.
Q37. How does DynamoDB handle query optimization?
DynamoDB optimizes queries by selecting the most efficient index and partition to retrieve data.
Q38. What is a secondary index in DynamoDB?
A secondary index is an index that allows you to query a DynamoDB table using an alternate key.
Q39. What is eventual consistency in DynamoDB?
Eventual consistency in DynamoDB means that it may take some time for all replicas of an item to be updated after a write operation.
The eventual consistency model is a method of ensuring that all copies of a data item are updated. It is often used in distributed systems, where it can take some time for changes to propagate to all nodes. The eventual consistency model guarantees that, given enough time, all copies of a data item will be updated.
Q40. What is strong consistency in DynamoDB?
Strong consistency in DynamoDB means that all replicas of an item are updated before a read operation is performed.
Q41. What is the difference between a DynamoDB table and a DynamoDB stream?
A DynamoDB table stores data while a DynamoDB stream captures changes to the data.
Q42. What is the maximum number of DynamoDB streams allowed per table?
The maximum number of DynamoDB streams allowed per table is two.
Q43. What is the maximum retention period for a DynamoDB stream?
The maximum retention period for a DynamoDB stream is 24 hours.
Q44. What is DynamoDB Accelerator (DAX)?
DynamoDB Accelerator (DAX) is a fully-managed in-memory cache for DynamoDB that provides faster performance and lower latency.
Q45. What is the purpose of DynamoDB Auto Scaling?
DynamoDB Auto Scaling automatically adjusts the read and write capacity of a DynamoDB table based on traffic patterns.
Q46. How does DynamoDB handle data encryption?
DynamoDB provides encryption at rest and in transit using AWS Key Management Service (KMS).
Q47. What is the difference between a strongly-typed and a weakly-typed attribute in DynamoDB?
A strongly-typed attribute in DynamoDB has a defined data type while a weakly-typed attribute does not.
Q48. What is the maximum number of items that can be retrieved in a single DynamoDB query?
The maximum number of items that can be retrieved in a single DynamoDB query is 1 MB.
Q49. What is the maximum number of tables that can be created in a single AWS account?
The maximum number of tables that can be created in a single AWS account is 256.
Q50. What is the purpose of DynamoDB point-in-time recovery (PITR)?
DynamoDB point-in-time recovery (PITR) allows you to restore a table to a specific point in time.
Q51. What is the difference between a hash key and a range key in DynamoDB?
A hash key is a required attribute for every item in a DynamoDB table and is used to determine the partition where the item is stored. A range key is an optional attribute that is used to sort items with the same partition key.
Q52. What is the difference between a reserved capacity and a provisioned capacity in DynamoDB?
A reserved capacity in DynamoDB is a commitment to pay for a certain amount of capacity for a specified period of time while a provisioned capacity is a specified amount of capacity that is allocated to a table.
Q53. What is the purpose of the DynamoDB backup feature?
The DynamoDB backup feature allows you to create on-demand backups and restore tables to a specified point in time.
Q54. What is the difference between a table backup and a table export in DynamoDB?
A table backup in DynamoDB includes all of the table’s attributes and indexes while a table export only includes the attributes that you specify.
Q55. Is Redis faster than DynamoDB?
Since DynamoDB is NoSQL, so Insert/Delete is so fast.(slower than Redis, but we don’t need to that much speed) DynamoDB store data permanently.
Q56. What is DynamoDB Auto Scaling?
DynamoDB is a superintended feature that scales up and down the read and write capacity of a DynamoDB or a global secondary index automatically.
Q57. What are API calls supported by a global secondary index?
“Query” and “Scan” are the API calls that are supported by Global Secondary Index.
Q58. How to delete a Global Secondary Index in Amazon DynamoDB?
A Global secondary index can be deleted from the console or through an API call.
Select the table from which you want to delete the Global Secondary index on the console, select the “indexes” tab under “Table items” and then click on the “Delete” button which is next to the delete index.
A Global Secondary Index can also be deleted using the Update Table API call.
Q59. Can I delete local secondary indexes?
Currently, Amazon DynamoDB is incapable of removing the local secondary indexes from the table once they are created, but it is possible to delete the entire table.
Q60. What are the key differences between Amazon DynamoDB and Amazon Aurora?
DynamoDB is NoSQL, whereas Aurora is a relational database service.
Aurora uses SQL for data manipulation and fetching, whereas DynamoDB uses a specialized syntax.
Aurora uses horizontal partitioning, whereas DynamoDB uses sharding as the partitioning method.
DynamoDB implements key-value and document models where Aurora operates with relational DBMS.
Aurora supports server-side scripting, but DynamoDB does not.
Q61. List 5 ways to fetch data from DynamoDB.
GetItem
Query
Scan
BatchGet
TransactRead
Q62. What are DynamoDB Projections?
As its name suggests, the attributes in a table projected to the index are the projections. (Similar to the GROUP BY operation in SQL). Projections can exclude all the unnecessary items and reduce the overall size of the payload returned by the API.
We have to define the projected attributes each time we create a local secondary index. Each index must have minimally three attributes: table partition key, index sort key, and table sort key.
Q63. How does DynamoDB prevent data loss?
There is long-term storage and a two-tier backup system in DynamoDB to keep data loss at a minimal level. There are three nodes for each participant, and each node contains the same data from the partition. In addition, there is a B tree for data location and a replication log to track the changes in each node. DynamoDB stores snapshots of these and stores them in another AWS database for a month for data restoration when necessary.
Q64. What are the DynamoDB pricing tiers?
On-demand capacity mode: This pricing tier focuses on the incoming traffic to the application and scales the database instance based on that. This pricing tier is ideal when the traffic is not predictable.
Provisioned capacity mode: This pricing tier lets users specify the reads and writes per second or choose auto-scaling. This option works best when the traffic is consistent and predictable.
Q65. What is the DynamoDB Local?
DynamoDB Local is a downloadable version of DynamoDB. It allows developing and testing applications in the local environment without using the DynamoDB web service. Once the application is ready for deployment, the local endpoint can be changed and redirected to the DynamoDB web service.
Q66. What are DynamoDB Global Tables?
DynamoDB Global Tables allow users to replicate their data over different regions of choice. That makes the data highly available and quickly delivered across global applications of enormous size. Every data write made to a global table is replicated over all the regions having replicas of the same table.
Q67. Explain DynamoDB – Time To Live (TTL).
DynamoDB – Time To Live (TTL): Automatically deletes items after an expiry timestamp.
Q68. Explain DynamoDB Integration with S3.
Export to S3: Must enable PITR. Works for any point of time for 35 days. Retain snapshot for auditing. ETL on top of S3 database before importing back into DynamoDB.
Import to S3: Import CSV, JSON, ION format. Creates a new table. Import errors logged into cloud watch logs.
Q69. What are DynamoDB Global Tables?
DynamoDB Global Table make a DynamoDB table accessible with low latency in the multiple region. Active-Active replication. Application can read and write to table in any region. Must enable DynamoDB streams as pre-requisites.
Q70. Explain DynamoDB Stream Processing.
DynamoDB Stream processing ordered streams of item level modification (create/update/delete) in a table. React to changes in real-time like welcome email to new users.
Recommended Articles
This has been a guide to the list of DynamoDB interview Questions and Answers so that the candidate can crack down on these Interview Questions easily. Here in this post, we have studied top DynamoDB Interview Questions and Answers for Interviews, which are often asked in interviews.