You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Understanding DynamoDB's core concepts is essential before you start building. This lesson covers tables, items, attributes, primary keys, and data types — the fundamental building blocks of every DynamoDB application.
A table is the top-level container for data in DynamoDB, similar to a table in a relational database:
An item is a single record in a table, similar to a row in a relational database:
{
"UserId": "user-001",
"Name": "Alice",
"Email": "alice@example.com",
"Age": 30
}
{
"UserId": "user-002",
"Name": "Bob",
"Phone": "+44-7700-900000",
"Address": {
"City": "London",
"Postcode": "SW1A 1AA"
}
}
Notice that Alice has Email and Age while Bob has Phone and Address — this is perfectly valid.
An attribute is a named data element within an item, similar to a column in a relational database:
DynamoDB supports three categories of data types:
| Type | Code | Description | Example |
|---|---|---|---|
| String | S | UTF-8 text | "Hello World" |
| Number | N | Numeric (integer or float) | 42, 3.14 |
| Binary | B | Base64-encoded binary data | "dGVzdA==" |
| Boolean | BOOL | True or false | true |
| Null | NULL | Null value | true (the value of the NULL type) |
| Type | Code | Description | Example |
|---|---|---|---|
| List | L | Ordered collection (like a JSON array) | ["red", "green", "blue"] |
| Map | M | Unordered key-value pairs (like a JSON object) | {"City": "London"} |
| Type | Code | Description | Example |
|---|---|---|---|
| String Set | SS | Set of unique strings | ["admin", "editor"] |
| Number Set | NS | Set of unique numbers | [1, 2, 3] |
| Binary Set | BS | Set of unique binary values | ["dGVzdA=="] |
Tip: Sets must contain elements of the same type, and all elements must be unique. Empty sets are not allowed.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.