Quick Start on DynamoDB: Part 1
This brief article explores DynamoDB and looks at terminology mapping, naming conventions, and more.
Join the DZone community and get the full member experience.
Join For FreeMy 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 to familiarize you with the following. This article can be considered a quick reference for the DynamoDB starters.
You may also like: Should You Use DynamoDB? (Part 1)
This will help to unlearn the RDBMS mindset and give you enough torque for learning and implementing this quickly.
DynamoDB is
- AWS NoSQL database
- 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 the following data types:
Basic:
string
number
binary
Boolean
Set:
Stringset
Numberset
Binaryset
Doc Types:
List
Map
Naming Conventions
Since Dynamo DB does not 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 prefixing 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.
- Up to 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.
Further Reading
Opinions expressed by DZone contributors are their own.
Trending
-
Five Java Books Beginners and Professionals Should Read
-
Front-End: Cache Strategies You Should Know
-
How to Use an Anti-Corruption Layer Pattern for Improved Microservices Communication
-
How AI Will Change Agile Project Management
Comments