Are you preparing for AWS Certified Developer Associate certification exam? In this space, we are writing series of articles on topics which are covered in the developer associate certification exam. You can subscribe to us for receiving the further updates on this topic.
Developer Associate certification exam is the most easiest exam in the associate level, it is good idea to start your certification from this exam. Also we would recommend you to pass the solutions architect certification exam which covers the concepts of all the services offered in AWS.
- TRY NOW : 10 Free Practice Questions for Developer Associate Exam
- OFFER : 420 Practice Questions for Developer Associate Exam (50% Discount)
Developer Associate Syllabus
Here is the snapshot of blueprint for developer associate is covered in the developer associate exam.
In this articles we are going to explain about the topic that addresses the Designing and Development as highlighted in the AWS Blueprint for the exam guide.
What is AWS DynamoDB?
The AWS DynamoDB is the fully managed NoSQL database offering from Amazon. This is excellent for organizations that do not want to manage their NoSQL databases. DynamoDB provides faster performance and improved scalability. The biggest advantage is that organizations don’t need to worry about provisioning the database or maintaining it in terms of patching or scaling.
A very important concept for the exam is the throughput provisioning for the database which is the read and write capacity that needs to be place for the database. This is what gets charged to the user when they use aws DynamoDB. Before we delve into throughout provisioning, let’s see how we can go about getting a DynamoDB in place.
How to Set up DynamoDB?
Let’s go through the following steps for creating a DynamoDB database.
Step 1:Log into your AWS Console. You will see the DynamoDB section under the database section.
Step 2: If you have never provisioned a DynamoDB table before you need to click on the ‘Create table’ option in the next screen.
Step 3: When creating the DynamoDB table, you will need to provide a table name and the primary key of the table. In our case, we are creating a table with the name of Demo and giving the primary key as ID.
When you scroll down the screen and uncheck the ‘Use default settings’ option, you will then see the option of Read capacity and write capacity units. You will also see the estimated cost per month. Leave the settings as it is. You can then click on the Create table at the bottom of the screen.
Once done you will actually then be able to see the Demo table.
Read and Write Capacity
So provisioned throughput is based on the read and write capacity that is put for the table. So now let’s understand the capacity in more detail.
- Read Capacity – This is the number of items, 4KB in size that can be read in one second from the table. So let’s say for example you have items which are 20KB in size that need to be read per second from the table. Then to calculate the read capacity, you need to divide the anticipated reads per second by 4KB. So in our case, we need to divide 20Kb by 4Kb and we get 5. So we need to provision 5 read capacity units for our table. We then need to go a step further because there are 2 types of read capacity. One is eventual consistency and the other is strongly consistent read.
- Eventual consistency is where aws tells that when data is read after a write, it may not reflect the exact data. Yes over a brief period of time, it eventual become consistent and a read would reflect the correct data.
- Eventual consistency is where aws tells that when data is read after a write it will always give you the most up to date data.
So now the following things need to be considered further for read capacity. Strong consistent reads are more expensive than eventual consistent reads. The default model for read capacity is eventual consistency. The next point to note is that one strongly consistent read is equal to 2 eventual consist reads.
So in our above case, we would get a value of 5 eventual consistent reads. But if we wanted strongly consistent reads then we would need to multiply the read capacity by 2, which would give the right read capacity for our table and that would be 10.
- Write Capacity – This is the number of items, 1KB in size that can be written in one second to the table. So let’s say for example you have items which are 20KB in size that need to be written per second to the table. Then to calculate the write capacity, you need to divide the anticipated writes per second by 1KB. So in our case, we need to divide 20Kb by 1Kb and we get 20. So we need to provision 20 writes capacity units for our table.
Local and Global Secondary Indexes
The next important concept in DynamoDB is local and secondary indexes. DynamoDB allows you to define indexes based on the columns of the table which make it easier to query the data.
Let’s take the example that we have the following items in our DynamoDB table.
To create an index we can go to the Indexes section in the DynamoDB table
- Click on the Create Index to create a new index for the table. Note that this will create a new global secondary index.
- We can now define another column in the table to become our primary key for the index.
- Also note that there is an additional read and write capacity for indexes.
The project attributes tells what parts of the table need to be part of the Index. You have the following options:
- All attributes – So all attributes from the table will be copied to the index.
- Keys – Here the keys from the table are copied to the index.
- Include – Here you can decide which attributes from the table should be part of the index.
A Local secondary index can use the same read write capacity of the main table. But these indexes can only be created at table creation time.
Also for a local secondary index, the primary key needs to be same as the primary partition key of the main table.
Important Points to Remember for Developer Associate Certification
- DynamoDB is the fully managed NoSQL offering from AWS.
- There is a charge for the read and write capacity for the DynamoDB table.
- To calculate read capacity we need to take the size of the anticipated reads to the nearest 4KB.
- Strong consistent reads are more expensive than eventual consistent reads.
- The default model for read capacity is eventual consistency.
- One strongly consistent read is equal to 2 eventual consist reads.
- To calculate write capacity we need to take the size of the anticipated writes to the nearest 1KB.
- A Local secondary index can use the same read write capacity of the main table
- The local secondary index can only be created at table creation time
- Also for a local secondary index, the primary key needs to be same as the primary partition key of the main table.
- For the global secondary index, the index primary can be different from the primary partition key of the main table.
In this article we have explained about how to create and configure the DynamoDB, how to create indexes and important points regarding the DynamoDB that needs to be remembered for the exam. DynamoDB is the fully functional NoSQL database from AWS. You are no longer required to use either MongoDB or other NoSQL databases if you are using the DynamoDB.
If you are preparing for the AWS certifications exam and looking for any help, please send us a mail to call to our customer support team.
- 7 pro tips for the AZ-900 exam: Microsoft Azure Fundamentals Certifications - March 17, 2023
- How to build and train Machine Learning Model? - March 13, 2023
- Preparation Guide for AWS Developer Associate Certification DVA-C02 - February 9, 2023
- Preparation Guide on Salesforce Platform App Builder Certification - February 5, 2023
- Exam tips on Google Cloud Certified Professional Cloud Architect - January 26, 2023
- Let’s begin you career in DevSecOps | An Exclusive Interview with DevSecOps Certified Expert – Andreas Horn - January 9, 2023
- 25 Free Question on AWS Certified SAP on AWS – Specialty Exam (PAS-C01) - December 19, 2022
- 7 pro tips to prepare for the AZ-500: Microsoft Azure Security Technologies Exam - November 14, 2022
2 thoughts on “AWS Certification : How to use DynamoDB?”
So in our above case, we would get a value of 5 eventual consistent reads. –
As per the calculation made above the 20KB per second means 5 Strong-consitent reads or 10 eventual consistent reads.
Isnt that so?
“Eventual consistency” is where aws tells that when data is read after a write it will always give you the most up to date data.
“Strong consistency” is where aws tells that when data is read after a write it will always give you the most up to date data.