November 05, 2024

DynamoDB

DynamoDB Overview

ร DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services (AWS).

ร It's designed for high-performance and scalable applications, offering low-latency access to data.

Key Concepts

ร NoSQL Database: DynamoDB is a NoSQL (Not Only SQL) database, meaning it doesn't rely on traditional relational database structures.

ร Tables: Data in DynamoDB is organized into tables, similar to a spreadsheet with rows and columns.

Data Model

ร Flexible Schema: DynamoDB allows dynamic addition or removal of attributes without affecting the entire table.

ร JSON-like Documents: Data within items is stored in JSON-like format, allowing nested structures.

Primary Key

ร Every DynamoDB table must have a primary key, which uniquely identifies each item.

ร Two Types: Primary keys can be either a single attribute (simple primary key) or a combination of two attributes (composite primary key).

Capacity Modes

ร Provisioned Throughput: Allows you to specify the read and write capacity units for your table.

ร On-Demand: Automatically scales based on the actual consumption, making it suitable for unpredictable workloads.


Consistency Models

ร  Strongly Consistent Reads: Ensures that read operations reflect the most recent write.

ร  Eventually Consistent Reads: Allows for lower read latency but may not reflect the latest write immediately.

 

DynamoDB Streams

ร  Captures and streams changes made to DynamoDB tables in real-time.

ร  Useful for triggering events, updating caches, or maintaining secondary indexes.

 

Security

ร  IAM Roles: Uses AWS Identity and Access Management (IAM) roles to control access to DynamoDB resources.

ร  Fine-Grained Access Control: Allows specifying access permissions at the item or attribute level.

 

Pricing

ร  Pay-Per-Request: On-demand pricing for read and write requests.

ร  Provisioned Throughput: Pay for a pre-allocated amount of read and write capacity.