Learn DynamoDB basics in 30 minutes.

Pankaj kushwaha
3 min readJan 14, 2021

--

1. Structural analysis
1. Structure
Table -> Project -> Properties. (Attributes can be nested)

2. Primary keys and indexes
Identify each item with a primary key, and use a secondary index.

3. Example (People table)
The distribution of the { method is very large {
“PersonID”: 101, the method “PersonID”: “102”,
“LastName”: “Pankaj”, “LastName”: “Kumar”,
“FirstName”: “Ankit” , “FirstName”: “Kumar”
“Phone”: “555–1234”
| — — — property — — — |
} }
| project — — — — — — — — — |
| — — — — — — — — — — — — — — — — — Table — — — — — — — — — — -|

Second, the primary key
1. Divided into two types
Partition key, partition key and sort key

2. Partition key
2.1. Determines the partition where this item is stored (physical storage inside DynamoDB)
2.2. A table with only a partition key, any two items cannot have the same key value (input to the hash function)

3. Partition key and sort key
3.1. Tables with this composite function can have the same partition key, but must have different sort keys.

Three, secondary index
1. DynamoDB has two indexes
2.1. Global secordary index, a partition key and sort key different from the table.
2.2. Local secondary index. An index with the same partition key but different sort keys.

2. Quantity limit
Define at most 5 global secondary indexes and 5 local secondary indexes for a table.

3. The base table of the index
Four, DynameoDB stream
1. Function
Stream is used to capture modification events in the table

2. Trigger conditions
2.1. Add new items to the table.
2.2. Updated the project.
2.3. Delete items from the table.

Five, data type
1. Scalar type
Such as: number, string, binary, Boolean, null

2. Document Type
Such as: list and mapping

2.1. List
Denoted by […]. Such as: favoriteThings: [“cookies”, “coffee”, 3.1415]
There is no restriction on the data type of the element.

2.2. Mapping
Expressed by {…}. { A day: “Monday”, an UnreadEmails: 42, an ItemsOnMyDesk: [ a “coffee cup”, a “Telephone”, one by one { one by one pens: {Quantity: 3}, one by one pens: {Quantity: 2}, one pens one by one : {Quantity: 1} one by one } one by one ] }

3. Set Type
Such as string and number set, binary set.

4. Attention
4.1. The document type supports nesting, up to 32 levels.
4.2. DynamoDB does not support empty strings and empty sets, but supports empty lists and mappings.

Six, programming interface
1. Interface classification
Low-level interface, document interface and object persistence interface.

2. Low-level interface

Please refer the below link for more information on this.

I like to learn new and better ways of doing things when working on a scale, and feel free to ask questions and make suggestions.
Also, check out another story on this.
Thanks for reading this.

--

--

Pankaj kushwaha
Pankaj kushwaha

Written by Pankaj kushwaha

Database/System Administrator | DevOPS | Cloud Specialist | DevOPS

No responses yet