Skip to main content
Welcome. This lesson covers Amazon DynamoDB, NoSQL database models, and high-availability (HA) design patterns. The content focuses on concepts you’ll need for system design and certification exams, and on practical guidance for building resilient, globally distributed NoSQL solutions.

NoSQL vs SQL

NoSQL (short for “not only SQL”) refers to non-relational databases that support flexible schemas and a variety of data models. SQL databases (relational) work best with well-defined schemas and normalized relations. NoSQL systems excel when you need horizontal scalability, low-latency reads/writes, and to store semi-structured or unstructured data at large scale.
A split infographic comparing SQL (shown as a table/grid of boxes on the left) with NoSQL (shown as stacked key → value pairs on the right).

NoSQL types

NoSQL databases come in multiple types, each optimized for particular access patterns and workloads:
A NoSQL infographic showing four types of databases. It has colored icons labeled Key-Value Stores, Document Stores, Column-Family Stores, and Graph Databases.

DynamoDB overview

Amazon DynamoDB is a fully managed NoSQL database service on AWS. It is primarily a key-value store with first-class support for document-like, nested attributes. Key capabilities include:
  • Fully managed, serverless operation with seamless autoscaling.
  • Multi-AZ replication for durability and high availability.
  • Low-latency single-digit millisecond and sub-millisecond read performance.
  • Integration with DynamoDB Streams for item-level change events.
  • Optional DynamoDB Accelerator (DAX) for an in-memory read cache to support ultra-low-latency read-heavy workloads.
DAX improves read latency but does not support DynamoDB transactional APIs (TransactWriteItems / TransactGetItems) and does not provide strongly consistent reads. Use DAX only for eventual-consistency read caching scenarios.
A slide titled "Features" showing a central blue database icon surrounded by circular blue icons and labels representing capabilities like stream integration, AWS ecosystem integration, performance at scale, fully managed service, seamless scalability, and high availability.

Transactions and ACID

Although DynamoDB is a NoSQL store, it provides transactional APIs (TransactWriteItems and TransactGetItems) that give ACID semantics within a single AWS Region. Transactions ensure:
  • Atomicity — Either all operations in the transaction succeed or none do.
  • Consistency — Conditional checks and constraints are enforced; invalid operations cause transaction failure.
  • Isolation — Partial changes are not visible before transaction commit.
  • Durability — Committed changes persist and survive failures due to multi-AZ replication.
DynamoDB single-item operations are durable thanks to multi-AZ replication, but multi-item or multi-table ACID guarantees require the transactional APIs.
A presentation slide titled "DynamoDB Transactions – ACID Properties" showing four colored panels labeled Atomicity, Consistency, Isolation, and Durability. Each panel includes a simple icon underneath representing the respective concept.

Basic DynamoDB elements

Understand these core concepts before modeling your data: Example item (employees table):

Composite keys

Composite primary keys (partition key + sort key) let you model one-to-many relationships and time-ordered data. Use the partition key for distribution and the sort key for range queries, sorting, and efficient retrieval of related items.

Global tables and multi-region replication

DynamoDB global tables enable multi-region replication, allowing you to deploy table replicas in multiple AWS Regions for lower-latency reads and multi-region resilience. Global tables replicate writes asynchronously between regions—replication is typically fast (often within seconds), but it is eventually consistent.
Global tables are multi-region and replicate asynchronously. Do not assume immediate, cross-region strong consistency—design your application to tolerate brief replication lag or consider conflict resolution strategies for concurrent regional writes.

Backups and point-in-time recovery (PITR)

DynamoDB supports on-demand backups and point-in-time recovery (PITR) for continuous protection within a region. For disaster recovery (DR) and long-term retention, use AWS Backup to create cross-region and cross-account backups.
An architecture diagram titled "Cross-Region and Cross-Account Backup (CRAB)" showing an AWS Organization with a Source Account and Destination Account in separate regions. Each account contains AWS Backup and an AWS Vault protecting a DynamoDB instance, with arrows indicating cross-account/cross-region backup replication.

Single-region architecture (limitations)

A common simple architecture uses API Gateway -> Lambda -> DynamoDB in a single region. While cost-effective and straightforward, this pattern creates a single-region point of failure: if the region becomes unavailable, the entire application can be unavailable.
A slide titled "Single Region (Before)" showing an AWS architecture in us-east-1: Amazon API Gateway -> AWS Lambda -> Amazon DynamoDB inside a dashed region. A callout notes this is a single point of failure (if us-east-1 goes down, the app becomes unavailable).

Multi-region and active-active architectures

To improve availability, reduce latency for global users, and avoid regional single points of failure, replicate data across multiple regions. Common approaches:
  • Global tables: automatic cross-region replication (eventual consistency).
  • Active-active: run full application stacks in multiple regions and route traffic (Route 53, geolocation-based routing, or latency-based routing). Use global tables or other replication mechanisms for the data tier.
  • Active-passive failover: a primary region accepts writes while secondary read-only regions remain on standby for failover.
The diagram below shows an active-active multi-region deployment with local front-end and app tiers in each region, DynamoDB global tables replicating data, and continuous backups for recovery.
An AWS "Active-Active" multi-region architecture diagram showing two mirrored regions with Elastic Load Balancers, VPCs, availability zones, and auto-scaling front-end and application servers. Route 53 handles routing while DynamoDB global tables provide automatic replication and continuous backup.

Design recommendations for HA and global scale

  • Choose your primary access pattern first; model DynamoDB keys (partition + sort keys) to satisfy that pattern.
  • Prefer single-table designs for many access patterns to reduce cross-partition queries, but balance complexity and maintainability.
  • Use transactions for strong ACID requirements within a region; avoid relying on cross-region transactional guarantees.
  • When using global tables, design for eventual consistency and conflict resolution for concurrent writes from multiple regions.
  • Complement global tables with cross-region backups (AWS Backup) and automated failover plans for robust DR.

Key takeaways

  • DynamoDB is a highly scalable, fully managed NoSQL database ideal for key-value and document patterns.
  • Use transactional APIs when you need ACID guarantees within a region; DynamoDB’s durability benefits from multi-AZ replication.
  • Global tables provide automatic cross-region replication for low-latency local reads but are eventually consistent—plan for replication lag.
  • Combine global tables, cross-region backups, and multi-region deployment patterns (active-active or active-passive) to meet availability and resilience requirements.

Watch Video