Introduction to AWS— DynamoDB

Abimuktheeswaran Chidambaram
4 min readNov 19, 2023

--

Amazon DynamoDB is a NoSQL database service that provides fast and predictable performance with seamless scalability. You can create database tables that can store and retrieve any amount of data. You can create on-demand backups and enable point-in-time recovery for your Amazon DynamoDB tables. Point-in-time recovery helps protect your tables from accidental write or delete operations during the last 35 days. You can use global tables to keep DynamoDB tables in sync across AWS Regions.

1. Concepts

DynamoDB stores data in tables. A table is a collection of data. Each table contains zero or more items. An item is a group of attributes. In DynamoDB, there is no limit to the number of items you can store in a table. Each item is composed of one or more attributes. An attribute is a fundamental data element. see the example of Non- a SQL database and SQL database below.

NON-SQL DATABASE
SQL database

In this, Department is the table name and ID, Name, class, and Location are Attributes, and 2, Finance operations, II, America are Item.

It supports various data types like scalar type (number, string, binary, Boolean, and null), document type (list and map), and set (string, number, and Boolean). For more details click here

2. Consistency Reads

Consistency refers to a database query returning the same data each time the same request is made. DynamoDB offers 3 types of consistencies here…

Eventually Consistency provides high availability and low latency, but it may not return the recently updated data. Eventually, consistent reads are supported on tables, local secondary indexes, global secondary indexes, and DynamoDB stream.

Strong consistency returns the recently updated data but does not provide high availability and low latency. Strongly consistent reads are supported on tables and local secondary indexes.

Global tables read consistency DynamoDB also supports global tables for multi-active and multi-region replication. Any change made to any item in any replica table is replicated to all the other replicas within the same global table, typically within a second, and is eventually consistent. For more details click here

3. Table classes in DynamoDB

DynamoDB offers two table classes to help you with cost optimization.

The DynamoDB Standard table class is the default and is recommended for the vast majority of workloads. In this, the table is accessed daily. The DynamoDB Standard-Infrequent Access (DynamoDB Standard-IA) table class is optimized for tables where storage is the dominant cost. In this, the table is accessed frequently. Each table class offers different pricing for data storage as well as for read and write requests. You can select the most cost-effective table class for your table based on its storage and throughput usage patterns. For more details click here

4. read/write capacity mode

The read/write capacity mode controls how you are charged for read and write throughput and how you manage capacity. You can set the read/write capacity mode when creating a table or you can change it later. DynamoDB offers 2 modes.

4.1 On-demand is a flexible billing option capable of serving thousands of requests per second without capacity planning. It delivers the same single-digit millisecond latency, service-level agreement (SLA) commitment, and security that DynamoDB already offers. On-demand mode is a good option for the following conditions, You create new tables with unknown workloads, unpredictable application traffic, and pay for only what you use.

4.2 By using Provisioned mode you specify the number of reads and writes per second that you require for your application. You can use auto-scaling to adjust your table’s provisioned capacity automatically in response to traffic changes. provisioned mode is a good option for the following conditions, predictable application traffic, You run applications whose traffic is consistent or ramps gradually, and You can forecast capacity requirements to control costs.

5. Encryption

All user data stored in Amazon DynamoDB is fully encrypted at rest. DynamoDB encryption at rest provides an additional layer of data protection by always securing your data in an encrypted table — including its primary key, local and global secondary indexes, streams, global tables, backups, and DynamoDB Accelerator (DAX) clusters.

When you access an encrypted table, DynamoDB decrypts the table data transparently. You don’t have to change any code or applications to use or manage encrypted tables. DynamoDB delivers the single-digit millisecond latency and seamless performance on your encrypted data. Regarding pricing, an AWS-owned key is offered at no additional charge. But charges apply for AWS-managed key and customer-managed key. DynamoDB encryption at rest is available in all AWS Regions.

click here to go for working with tables.

Thanks for Reading! Have a seamless DB day

Last updated: 07-Jan-2024

--

--

No responses yet