Skip to main content
This lesson gives a high-level overview of Amazon DynamoDB, AWS’s fully managed NoSQL database service. Expect DynamoDB to appear frequently on AWS certification exams (for example, the AWS Certified Developer — Associate). Before diving into DynamoDB specifics, it’s useful to briefly review NoSQL concepts. NoSQL databases trade rigid schemas for flexible data models and horizontal scalability. They are optimized for large volumes of unstructured or semi-structured data and different access patterns than relational databases. NoSQL database types
What is DynamoDB? DynamoDB is AWS’s managed NoSQL database designed for low-latency, predictable performance at any scale. It removes most operational overhead (provisioning, patching, replication, hardware management) while providing built-in high availability and durability. A typical architecture places your application between end users and DynamoDB: the application issues reads and writes, and DynamoDB stores the application’s state, sessions, configuration, or business data.
Key benefits and features
  • Seamless scalability: DynamoDB scales automatically to handle growing traffic and data volumes.
  • Predictable low latency: single-digit millisecond read/write latencies for typical use cases.
  • Flexible data model: store items with attributes (including nested documents) without a fixed schema.
  • Pay-as-you-go pricing: you pay for throughput and storage consumed; choose on-demand or provisioned capacity.
Additional capabilities
  • High availability & durability: data is replicated across multiple Availability Zones.
  • Streams: DynamoDB Streams capture item-level changes in time order for change processing or replication.
  • AWS integrations: works well with AWS Lambda, Amazon S3, Amazon Redshift, and many other services.
ACID transactions DynamoDB supports ACID transactions for multi-item, multi-table operations. When you need transactional guarantees, DynamoDB provides:
  • Atomicity — all operations in a transaction succeed or none do.
  • Consistency — transactions maintain defined constraints and consistency rules.
  • Isolation — in-flight transaction changes are not visible until commit.
  • Durability — committed transactions persist despite failures.
Use DynamoDB transactions when you require strong consistency across multiple items (for example, transferring balances between accounts). Transactions incur additional cost and throughput considerations, so use them only when necessary.
DynamoDB data model: tables, items, attributes
  • Table: a container for items (analogous to a table in other databases).
  • Item: a single record in a table (e.g., a user or an order).
  • Attribute: a key-value pair on an item. Attributes can be scalars (string, number, binary) or complex (lists, maps).
Example item (JSON):
Naming rules and limits
  • Names must be UTF-8 encoded and are case-sensitive.
  • Table and index names: between 3 and 255 characters.
  • Attribute names: at least 1 character; the attribute name size can be large (up to implementation limits).
Primary key overview Every item must have a primary key that uniquely identifies it. Design the primary key to match your application’s access patterns. Two primary key types:
  1. Partition key (simple primary key)
    • A single attribute.
    • Each item must have a unique partition key value in the table.
  2. Composite primary key (partition key + sort key)
    • The partition key groups items; the sort key orders items within the partition.
    • The pair (partition key, sort key) must be unique. The same partition key can appear in multiple items if the sort key differs.
Primary keys are immutable: you cannot change an item’s primary key values. To “change” a primary key you must create a new item and delete the old one.
Composite primary key example Composite keys help model one-to-many or hierarchical relationships in a single table. Example: a Reviews table where a user can leave multiple reviews for different products.
  • Partition key: user_id
  • Sort key: product_id
This allows multiple reviews per user (same user_id, different product_id) while preventing duplicate user_id/product_id pairs.
Querying with PartiQL DynamoDB supports PartiQL, an SQL-compatible query language that simplifies querying and modifying items using familiar SQL syntax. Example PartiQL query:
PartiQL is convenient for quick reads and for people coming from relational databases, but keep in mind that DynamoDB still enforces primary key access patterns and scalability characteristics. Summary
  • NoSQL databases (including DynamoDB) provide flexible schemas and horizontal scalability for large datasets.
  • DynamoDB is a fully managed, high-performance NoSQL service with automatic scaling, high availability, and integration across the AWS ecosystem.
  • Data model: tables → items → attributes (attributes can be nested).
  • Primary keys uniquely identify items: choose a single partition key or a composite key (partition + sort) based on your query patterns.
  • DynamoDB supports ACID transactions and PartiQL for SQL-like queries.
Further reading and references Use the above references to deepen your understanding of DynamoDB integration patterns, pricing models (on-demand vs provisioned), and best practices for table design and indexing.

Watch Video