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, serverless, key-value and document database designed to deliver single-digit-millisecond performance at any scale. It handles more than 10 trillion requests per day and can support peaks of more than 20 million requests per second. DynamoDB is the backbone of many high-profile AWS services and customers including Amazon.com, Lyft, Airbnb, and Capital One.
Traditional relational databases scale vertically — you buy a bigger server when you need more capacity. DynamoDB scales horizontally by partitioning data across many servers automatically. This architecture delivers:
A DynamoDB table is a collection of items. Unlike a relational table, items in the same DynamoDB table can have different attributes (schema-less within the table).
An item is a single data record, similar to a row in a relational table. Each item is uniquely identified by its primary key and can be up to 400 KB in size.
Attributes are the data elements within an item, analogous to columns. DynamoDB supports scalar types (String, Number, Binary, Boolean, Null), document types (List, Map), and set types (String Set, Number Set, Binary Set).
Every DynamoDB table requires a primary key. There are two types:
A single attribute that DynamoDB uses to hash and distribute items across partitions.
Table: Users
Partition Key: userId
┌──────────┬──────────────┬───────────┐
│ userId │ name │ email │
├──────────┼──────────────┼───────────┤
│ U001 │ Alice Smith │ a@ex.com │
│ U002 │ Bob Jones │ b@ex.com │
└──────────┴──────────────┴───────────┘
Two attributes: the partition key determines which partition stores the item, and the sort key orders items within that partition. This enables efficient range queries.
Table: Orders
Partition Key: customerId
Sort Key: orderDate
┌────────────┬────────────┬─────────┬────────┐
│ customerId │ orderDate │ orderId │ total │
├────────────┼────────────┼─────────┼────────┤
│ C001 │ 2025-01-15 │ ORD-101 │ 49.99 │
│ C001 │ 2025-03-22 │ ORD-205 │ 129.00 │
│ C002 │ 2025-02-10 │ ORD-150 │ 74.50 │
└────────────┴────────────┴─────────┴────────┘
With this design you can efficiently query all orders for customer C001 between two dates.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.