Before using DynamoDB, you must familiarize yourself with its basic components and ecosystem. In the DynamoDB ecosystem, you work with tables, attributes, and items. A table holds sets of items, and items hold sets of attributes. An attribute is a fundamental element of data requiring no further decomposition, i.e., a field.
Primary Key
The Primary Keys serve as the means of unique identification for table items, and secondary indexes provide query flexibility. DynamoDB streams record events by modifying the table data.
More Info: 1Z0-064: Oracle Database 12c - Performance Management and Tuning
The Table Creation requires not only setting a name, but also the primary key; which identifies table items. No two items share a key. DynamoDB uses two types of primary keys −
◉ Partition Key − This simple primary key consists of a single attribute referred to as the “partition key.” Internally, DynamoDB uses the key value as input for a hash function to determine storage.
◉ Partition Key and Sort Key − This key, known as the “Composite Primary Key”, consists of two attributes.
◉ The partition key and
◉ The sort key.
DynamoDB applies the first attribute to a hash function, and stores items with the same partition key together; with their order determined by the sort key. Items can share partition keys, but not sort keys.
The Primary Key attributes only allow scalar (single) values; and string, number, or binary data types. The non-key attributes do not have these constraints.
Secondary Indexes
These indexes allow you to query table data with an alternate key. Though DynamoDB does not force their use, they optimize querying.
DynamoDB uses two types of secondary indexes −
◉ Global Secondary Index − This index possesses partition and sort keys, which can differ from table keys.
◉ Local Secondary Index − This index possesses a partition key identical to the table, however, its sort key differs.
API
The API operations offered by DynamoDB include those of the control plane, data plane (e.g., creation, reading, updating, and deleting), and streams. In control plane operations, you create and manage tables with the following tools −
◉ CreateTable
◉ DescribeTable
◉ ListTables
◉ UpdateTable
◉ DeleteTable
In the data plane, you perform CRUD operations with the following tools −
Create | Read | Update | Delete |
PutItem BatchWriteItem |
GetItem BatchGetItem Query Scan |
UpdateItem |
DeleteItem BatchWriteItem |
0 comments:
Post a Comment