Codementor Events

Quick Start : Dynamo DB Part 1

Published Nov 25, 2019Last updated Nov 28, 2019
Quick Start : Dynamo DB Part 1

My intention is to make it loud and clear that learning Dynamo DB is simple and easy to use. Before we jump right into it, I would like you to familiarize with the following. This article can be considered as a quick reference for the DynamoDB starters.

This will help to unlearn RDBMS mind set and give you enough torque for learning and implementing this quickly.

DynamoDB is

• AWS NoSQL Database
• It is fast and flexible
• Cost Effective
• Highly Scalable
• Secure and Fault Tolerant

Terminology Mapping to RDBMS

RDBMS DynamoDB


Table Table
Rows Items
Columns Attributes
Multicolumn – Primary Mandatory Primary Key
Indexes Local Secondary Indexes
Views Global Secondary Indexes

**Dynamo DB supports following datatypes **
Basic:
string,
number,
binary,
Boolean
Set:
Stringset,
Numberset,
Binaryset
Doc Types:
List,
Map

Naming Conventions
Since Dynamo DB doesnot allow multiple database concept like RDBMS, we should follow some naming convention to identify the tables related to each project otherwise it will be difficult to maintain.

We always suggest prefix the table name with product.
e.g: myProduct.userTable

Consistency Models:
Strong Consistency:

A strongly consistent is used to read and return a result that reflects all the writes that was received as a successful response prior to the read.
• Upto date

Eventual Consistency:

The eventual consistency option is used to maximize the read throughput. Consistency across all copies of data is usually reached within a second. Repeating a read after a short time should return the updated data.
• 50% Cheaper
• May or may not reflect the latest copy of data
• Default consistency for all operations

Capacity Units

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 while creating a table. You can change it later.
Throughput Capacity
Used to control r/w throughput
Support Auto Scaling
1 Capacity unit = 1 req/sec
Read Capacity Unit
1 RCU = 1 strongly consistent table read / sec
Or
1 RCU = 2 eventually consistent table read / sec
In block of 4 kb
Write Capacity Unit
1 WCU = 1 table write / sec
In block of 1 kb

In the next article we will see about Partition key, indexing and creating tables using aws consoles. Hope this helps.

Discover and read more posts from Kishan
get started
post commentsBe the first to share your opinion
Show more replies