Amazon DynamoDB Basics
Learn how DynamoDB structures and stores data and explore how to integrate DynamoDB effectively into scalable, real-world applications.
DynamoDB is Amazon’s fully managed NoSQL database designed for millisecond performance at scale. It’s a perfect fit for applications requiring high availability, flexible schemas, and seamless scaling.
DynamoDB stores data in tables, which contain items, and each item is composed of attributes. A table functions similarly to a relational database table, storing structured information related to a specific entity, such as users, orders, or products. Each item in a DynamoDB table is a unique record, much like a row in a relational table, although the schema may vary across items. Attributes represent an item's data fields, similar to columns in other databases.
DynamoDB is built on persistent storage systems. This means that once data is written to DynamoDB, it remains available even if a hardware failure occurs, an instance reboots, or other system maintenance happens. This durability is a key part of DynamoDB’s managed service guarantees.
In contrast, some services use ephemeral storage, which is temporary and lost when the underlying resource (like an EC2 instance) is stopped or terminated. While using DynamoDB tables:
The data is replicated across multiple Availability Zones (AZs) within a Region to ensure durability and availability.
We do not need to worry about manually backing up your tables for basic durability (although backup and restore features exist for compliance and recovery purposes).
Understanding the difference helps developers design resilient, scalable cloud-native applications without worrying about underlying hardware.
Primary key structure
Every table must specify a primary key, which determines how data is distributed and queried. The primary key can be either a simple partition key or a composite key:
Partition key: When using a partition key (also called a hash key), DynamoDB uses the key’s value to determine the partition, or physical storage node, on which to store the item. This mechanism enables high ...