Knowledge Transfer

Ethickfox kb page with all notes


Project maintained by ethickfox Hosted on GitHub Pages — Theme by mattgraham

Tables, Items and Attributes

support for ACID transactions

DynamoDB is serverless. You don't have to provision, patch, or manage servers, and you don't have to install, maintain, or operate software. DynamoDB automatically scales tables up and down to adjust for capacity and maintain performance.

Untitled15.png

The primary key is used to uniquely identify each item in an Amazon DynamoDB table. A primary key is of two types:

  1. Simple Primary Key: This is composed of one attribute called the Partition Key. If we wanted to store a customer record, then we could have used customerID or email as a partition key to uniquely identify the customer in the DynamoDB table.
  2. Composite Primary Key: This is composed of two attributes - a partition key and a sort keys. In our example above, each order is uniquely identified by a composite primary key with customerID as the partition key and orderID as the sort key.

When we write an item to the table, DynamoDB uses the value of the partition key as input to an internal hash function. The output of the hash function determines the partition in which the item will be stored.

We can use a secondary index to query the data in the table using an alternate key, in addition to queries against the primary key. Secondary Indexes are of two types:

DynamoDB is a web service, and interactions with it are stateless. So we can interact with DynamoDB via REST API calls over HTTP(S). Unlike connection protocols like JDBC, applications do not need to maintain a persistent network connections.

Untitled11.png

40.png

Data types

Operation types

"global Secondary index" refers to an index with a partition and divided key that differs from those on the table. Per table, a maximum of 5 global associated indexes are permitted.

• Local secondary index: An index with a different sort key than the table's partition key. Since every index partition is bound to a table partition with the same partition key, it is regarded as being "local."There can be a maximum of five local associated indexes per table.Currently, once local secondary indexes are created, Amazon DynamoDB is unable to remove them from the table; however, the entire table can be deleted.

Projection

Represents attributes that are copied (projected) from the table into an index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

The set of attributes that are projected into the index:

What sort of query functionality is supported by DynamoDB?

It supports GET/PUT operations using the user-specified primary key. The ability to query a non-primary key attribute using both local and global secondary indexes promotes flexible querying.

DynamoDB Atomic

Atomic counters are a feature of DynamoDB that let you change the value of an established attribute without affecting other write requests by using the update method. It increases the value of this characteristic by one each time the programme is executed.

Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available caching service built for Amazon DynamoDB. DAX delivers up to a 10 times performance improvement—from milliseconds to microseconds—even at millions of requests per second.

DAX does all the heavy lifting required to add in-memory acceleration to your DynamoDB tables, without requiring developers to manage cache invalidation, data population, or cluster management.

DynamoDB's provisioned throughput feature enables users to specify the read and write capacity needs for their table. The user can then make sure that one‘s table can accommodate the volume of traffic they anticipate.