Amazon DynamoDB Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(33 intermediate revisions by the same user not shown)
Line 7: Line 7:


* [[Amazon DynamoDB#Subjects|Amazon DynamoDB]]
* [[Amazon DynamoDB#Subjects|Amazon DynamoDB]]
* [[Distributed_Systems#Consistent_Hashing|Distributed Systems]]


=Overview=
=Overview=


Amazon DynamoDB is a managed NoSQL database service.
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=
=Table=
Line 16: Line 17:
A table is a collection of [[#Item|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.
A table is a collection of [[#Item|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.


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.
When a table is created, its [[#Primary_Key|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=
=Item=
Line 24: Line 25:
=Primary Key=
=Primary Key=


DynamoDB uses primary keys to uniquely identify each [[#Item|item]] in a [[#Table|table]].
DynamoDB uses primary keys to uniquely identify each [[#Item|item]] in a [[#Table|table]]. There are two types of primary keys: [[#Partition_Key|partition key]] and [[#Partition_Key_and_Sort_Key|partition and sort key]]. Each primary key attribute must be a [[#Scalar|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 [[#Partition_Key|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=
=Attribute=
Line 30: Line 39:
An attribute is a fundamental data element, something that does not need to be broken down any further.
An attribute is a fundamental data element, something that does not need to be broken down any further.


=Attribute Types=
==Nested Attributes==
 
DynamoDB supports nested attributes up 32 levels deep.
 
=<span id='Attribute_Types'></span>Data Types=
 
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes</font>


==Scalar==
==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=
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html</font>
=DynamoDB Stream=
<font color=darkgray>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
</font>


=Encryption at Rest=
=Encryption at Rest=


=Point-in-time Recovery=
=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.
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.ControlPlane</font>
==Data Plane==
Data plane operations let you perform create, read, update, and delete (also called CRUD) actions on data in a table.
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.DataPlane</font>
=Transaction=
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.Transactions</font>
=Naming Rules=
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.NamingRules</font>
=Read Consistency=
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html</font>
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=
<font color=darkgray>
TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html</font>
=Partition and Data Distribution=
<font color=darkgray>TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.Partitions.html</font>

Latest revision as of 20:09, 5 June 2019

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

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes

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:

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.

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.ControlPlane

Data Plane

Data plane operations let you perform create, read, update, and delete (also called CRUD) actions on data in a table.

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.DataPlane

Transaction

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.API.html#HowItWorks.API.Transactions

Naming Rules

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.NamingRules

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

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html

Partition and Data Distribution

TODO: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.Partitions.html