Amazon DynamoDB Concepts
External
Internal
Overview
Amazon DynamoDB is a managed NoSQL schemaless database service. DynamoDB is available in multiple AWS regions around the world, but each region is independent and isolated from other AWS regions.
Table
A table is a collection of items. A table contains zero or more items. An item is a group of attributes that is uniquely identifiable among all other items. Items are similar in many ways to rows, records or tuples in other database systems. There is no limit to the number of items that can be stored in a table.
When a table is created, its primary key must be specified. Other than the primary key, tables do not have schemas, which means that neither the attributes nor their data types need to be defined beforehand.
Item
An item is a collection of attributes. Each item can have its own distinct attributes.
Primary Key
DynamoDB uses primary keys to uniquely identify each item in a table. There are two types of primary keys: partition key and partition and sort key. Each primary key attribute must be a scalar (string, number, or binary).
Partition Key
A simple primary key defined by one attribute. In a table that has only a partition key, no two items can have the same partition key value. DynamoDB uses the partition key's value as input to an internal hash function. The output from the hash function determines the partition (physical storage internal to DynamoDB) in which the item will be stored. The partition key of an item is also known as its hash attribute.
Partition Key and Sort Key
A primary key may be composite, in that it is defined by two attributes: the partition key and the sort key. The partition key is used as described above. All items with the same partition key value are stored together, in sorted order by sort key value. In a table that has a partition key and a sort key, it's possible for two items to have the same partition key value. However, those two items must have different sort key values. The sort key of an item is also known as its range attribute. The term range attribute derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Attribute
An attribute is a fundamental data element, something that does not need to be broken down any further.
Nested Attributes
DynamoDB supports nested attributes up 32 levels deep.
Data Types
Scalar
Number
String
Binary
Boolean
null
Document Types
A document type can represent a complex structure with nested attributes—such as you would find in a JSON document.
List
Map
Set Types
A set type can represent multiple scalar values.
String Set
Number Set
Binary Set
Secondary Index
TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html
DynamoDB Stream
TODO:
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.Streams
Encryption at Rest
Point-in-time Recovery
API
Control Plane
Control plane operations let you create and manage DynamoDB tables. They also let you work with indexes, streams, and other objects that are dependent on tables.
Data Plane
Data plane operations let you perform create, read, update, and delete (also called CRUD) actions on data in a table.
Transaction
Naming Rules
Read Consistency
TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html
When an application writes data to a DynamoDB table and receives an HTTP 200 response, the write has occurred and is durable. The data is eventually consistent across all storage locations, usually within one second or less.
Eventually Consistent Reads
In an eventual consistent model, a read might not reflect the results of a recently completed write operation. The response might include some stale data. If the read is repeated after a short time, the response should return the latest data.
Eventually consistent read is the default behavior, unless specified otherwise.
Strong Consistent Reads
In a strongly consistent model, a read returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. A strongly consistent read might not be available if there is a network delay or outage. Consistent reads are not supported on global secondary indexes (GSI).
Read/Write Capacity Mode
Partition and Data Distribution
TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.Partitions.html