Core Concepts Flashcards
Core Components
- Tables, Items, and Attributes.
- Primary Key.
- Secondary Indexes.
- DynamoDB Streams
Tables
A table is a collection of data.
Items
An item is a group of attributes that is uniquely identifiable among all of the other items.
Items in DynamoDB are similar in many ways to rows, records, or tuples in other database systems.
Attributes
An attribute is a fundamental data element, something that does not need to be broken down any further.
Attributes in DynamoDB are similar in many ways to fields or columns in other database systems.
Primary Key
The primary key uniquely identifies each item in the table.
DynamoDB supports two different kinds of primary keys:
- Partition key.
- Partition key and sort key – Referred to as a composite primary key
Partition key.
A simple primary key, composed of one attribute known as the partition key.
Partition key and sort key
Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key.
Secondary Indexes
A secondary index lets you query the data in the table using an alternate key, in addition to queries against the primary key.
DynamoDB supports two kinds of indexes:
- Global secondary index.
- Local secondary index.
Each table in DynamoDB has a quota of 20 global secondary indexes (default quota) and 5 local secondary indexes per table.
When you create an index, you specify which attributes will be copied, or projected, from the base table to the index.
Global secondary index
An index with a partition key and sort key that can be different from those on the table.
Local secondary index
An index that has the same partition key as the table, but a different sort key.
DynamoDB Streams
is an optional feature that captures data modification events in DynamoDB tables. The data about these events appear in the stream in near-real time, and in the order that the events occurred.