DynamoDB: A Fully Managed NoSQL Database for Developers

An engineer excelled in developing data solutions using Big Data Technologies and Machine Learning algorithms in the Cloud infrastructure.
Search for a command to run...

An engineer excelled in developing data solutions using Big Data Technologies and Machine Learning algorithms in the Cloud infrastructure.
No comments yet. Be the first to comment.
As part of this series, I will be highlighting the Amazon Web Services (AWS) services and practices that I use in both my personal and professional capacities.
Sharing my experience of how I am running the Twitter Bot on AWS for almost free using AWS serverless technologies. Social Bot is nothing but a program that mimics the behaviors of a user based on the rules you set. Twitter is one of the BOT friendl...
Git is a source code management system that keeps track of the changes made to their codebase and collaborates with other team members. It is commonly used for source code management in software development, but it can track changes to any set of fil...

What It Is and Why It Matters?

It's no secret that cyber intelligence pros must have data engineering skills. But what exactly is data engineering? Data engineering is a skill that's used to collect and analyze data. Then, it can be used to understand the data's quality and make p...

Build, deploy, and manage mobile and web apps that need real-time or offline data are simple with AWS AppSync, a fully managed serverless GraphQL service. Your apps may securely access and work with data stored in AWS services like Amazon DynamoDB, A...

AWS re: Invent is a learning conference hosted for the global cloud computing community with in-person and virtual content where they announced many new features and updates. This post is the summary of the list of changes within the Data & Analytics...

DynamoDB is a fully managed NoSQL database from Amazon Web Services (AWS). It is a document database which means the data is stored in key/value pairs. The DynamoDB stores the data across 3 different availability zones in a region.
Since it is a fully managed service, DynamoDB is well suited for various workloads with any amount of data that require auto-scaling from small to large and anywhere in between.
Generally scaling databases is hard and risky, but DynamoDB gives you the ability to auto-scale based on the usage which allows your system to adjust according to the traffic and other needs.
Access control policies and encryptions are available for your tables, so it makes the database more secure and accessible to the appropriate users without any bottlenecks.
DynamoDB streams enable developers to access the data when it happens which makes the DynamoDB suitable for many complex solutions.
DynamoDB creates and keeps the backup of your data safely on the cloud, so in the event of any occurrence, you can safely retrieve the data.
TTL allows you to define when to expire the items in a table so they get deleted automatically from the database.
Some of the important guidelines to assess your suitability of using DynamoDB are as follows:
DynamoDB is well suitable for any business-critical applications which require higher scalability and is predominantly used for transactions processing (OLTP)
DynamoDB is not suitable for data warehousing and OLAP purposes.
DynamoDB supports two types of reading such as Eventually Consistent Read and Strongly Consistent Read, By default, it is set to Eventually Consistent Read.
In the Eventually consistent read, data may not be consistent as the copies of data will generally be available in 1 second. Whereas, a Strongly consistent read will always be up-to-date since it fetches the straight from the leader node.
DynamoDB does not support strongly consistent reads across AWS regions
DynamoDB offers two capacity modes, Provisioned and On-Demand. In the Provisioned mode, the developer would need to define the read and write capacity of the database.
On-demand mode is a flexible way to provision your DynamoDB tables to serve thousands of requests without doing any capacity planning.
Switching between provisioned and on-demand modes can be done once every 24 hours.
Read capacity units represents one strongly consistent read per second or two eventually consistent reads per second for an item of up to 4KB.
Let's see how we calculate RCU for strongly consistent read:
\= 50 X 40/4 = 500 RCUs
\= 50/2 X 40/4 = 250 RCUs
One write capacity unit represents one write of 1 KB per second, so for example, if we need 50 writes of 40 KB per item:
\= 50 X 40 = 2000 WCUs
The partitions in DynamoDB slice the table as multiple chunks of data for faster reads. It automatically creates partitions on every 10GB of data or when your application exceeds 3000 RCUs or 1000 WCUs in a single partition. Generally, DynamoDB will try to evenly distribute the RCU and WCU capacities across the partitions.
The primary key determines the partition to store the data, so it is important to get the primary key correct to be able to distribute the data across the partitions for better performance.
DynamoDB can have two keys
Primary Key
Sort Key
Primary Key can either be simple or composite keys. Composite keys consist of both a partition and a sort key.
Sort Key helps to organize the data in DynamoDB. So sort keys logically group the data in one place for efficient querying purposes.
DynamoDB allows your application to query the table using an alternate key, in addition to queries against the primary key. The two types of indexes are as follows:
Global Secondary Index (GSI) An index with a partition key and sort key that can be different. It only supports eventually consistent reads, and it can be created or modified at any time.
Local Secondary Index (LSI) An index that has the same partition key as the table, but a different sort key. It supports strongly or eventual consistent reads, and it can be created only during the initial table creation.
DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for DynamoDB.
DAX can reduce the response times to microseconds.
DAX only supports the server-side encryption
DAX is not ideal for write-intensive workloads
DynamoDB provides on-demand backup capability as well as enable point-in-time recovery for your DynamoDB tables.
Backups includes the data, indexes, streams and provisioned capacity of RCU's and WCU's
DynamoDB usage can be monitored using CloudWatch and CloudTrail.