You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Amazon DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services (AWS). It delivers single-digit millisecond performance at any scale, making it one of the most popular choices for modern, high-throughput applications.
Traditional relational databases (RDBMS) store data in tables with fixed schemas, use SQL for queries, and prioritise consistency (ACID transactions). NoSQL databases take a different approach:
| Feature | Relational (SQL) | DynamoDB (NoSQL) |
|---|---|---|
| Schema | Fixed, pre-defined columns | Flexible, each item can have different attributes |
| Query language | SQL | API calls, PartiQL (SQL-compatible) |
| Scaling | Vertical (bigger server) | Horizontal (add more partitions) |
| Consistency | Strong by default | Eventually consistent by default, strong optional |
| Joins | Native JOIN operations | No joins — denormalise data instead |
| Transactions | Full ACID | ACID across up to 100 items |
DynamoDB is classified as a key-value and document database. Each item is identified by a primary key and can store structured, semi-structured, or nested data using JSON-like attributes.
DynamoDB removes all operational burden:
DynamoDB is designed for consistent, single-digit millisecond latency:
DynamoDB integrates naturally with serverless architectures:
| Use Case | Why DynamoDB? |
|---|---|
| Web and mobile applications | Low latency, auto-scaling, flexible schema |
| Gaming leaderboards | Fast reads/writes, atomic counters |
| IoT data ingestion | Millions of writes per second |
| Session management | TTL for automatic session expiry |
| E-commerce shopping carts | High availability, conditional writes |
| Real-time analytics | DynamoDB Streams with Lambda processing |
| Content management | Flexible schema for varied content types |
| Ad tech | Millisecond response times at massive scale |
| Feature | DynamoDB | MongoDB (Atlas) | Cassandra | Redis |
|---|---|---|---|---|
| Managed | Fully | Fully (Atlas) | Self or managed | Fully (ElastiCache) |
| Data model | Key-value + document | Document | Wide column | Key-value |
| Max item size | 400 KB | 16 MB | 2 GB (partition) | 512 MB |
| Consistency | Eventual + strong | Strong + causal | Tunable | Strong (single node) |
| Scaling | Automatic | Manual sharding | Manual ring | Cluster mode |
| Serverless mode | Yes | Yes | No | No |
| Transactions | Yes (up to 100 items) | Yes | Lightweight | Yes (single shard) |
You can interact with DynamoDB using:
aws dynamodb create-table \
--table-name Users \
--attribute-definitions \
AttributeName=UserId,AttributeType=S \
--key-schema \
AttributeName=UserId,KeyType=HASH \
--billing-mode PAY_PER_REQUEST
This creates a table called Users with a partition key UserId (String) using on-demand billing.
DynamoDB is a fully managed, serverless NoSQL database that delivers single-digit millisecond performance at any scale. It eliminates operational overhead, scales horizontally, and replicates data across multiple Availability Zones for high availability. Its flexible data model, event-driven integration, and pay-per-use pricing make it an excellent choice for modern applications. In the next lesson, we will explore DynamoDB's core concepts — tables, items, attributes, and primary keys.