KEMBAR78
Dynamo DB | PDF | Information Technology Management | Data Management Software
0% found this document useful (0 votes)
75 views1 page

Dynamo DB

Amazon DynamoDB is a fully-managed, high-performance database that scales on demand and offers two capacity modes: on-demand and provisioned. It supports flexible data types and requires a primary key for document identification, with options for secondary indexes and backup solutions. Key features include adaptive capacity, optimistic locking, and the ability to handle race conditions, making it suitable for various traffic patterns and use cases.

Uploaded by

maciewehner8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views1 page

Dynamo DB

Amazon DynamoDB is a fully-managed, high-performance database that scales on demand and offers two capacity modes: on-demand and provisioned. It supports flexible data types and requires a primary key for document identification, with options for secondary indexes and backup solutions. Key features include adaptive capacity, optimistic locking, and the ability to handle race conditions, making it suitable for various traffic patterns and use cases.

Uploaded by

maciewehner8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

AMAZON DYNAMODB

A FULLY-MANAGED DATABASE WITH HIGH PERFORMANCE AT ANY SCALE


INTRODUCTION CAPACITY MODES ON-DEMAND VS. PROVISIONED FREE TIER BASIC CONCEPTS
Why should you care about DynamoDB?
You can choose between those two types, which can be Go with On-Demand if you got unpredictable traffic, as it Your first year includes 25 Read & Write Capacity Units In comparison to SQL, a document in DynamoDB doesn't
Because it's fully managed, highly available & scales on- changed any time.
scales immediately and you're only paying for what you each for provisioned capacity mode every month.
have a fixed schema. What is defined by the table: the
demand with low latencies.
• provisioned - specifying the capacity units for your table & actually use.
primary key, which uniquely identifies a single document.
For getting you hooked, at Prime Days 2021 DynamoDB you'll be independently charged of your actual usage.
With steady load or known patterns, pick provisioned as

it can be up to almost 7 times less expensive.

served 89.2 million requests per second at its peak! • on-demand - you’ll be charged per request.

The best fit highly depends on your traffic patterns.

PRIMARY KEYS PARTITION KEYS


It's is a documents unique identifier & Internally, DynamoDB consists of
HOT PARTITIONS Rule of thumb
must be provided when inserting a different partitions and your partition
Your provisioned read & write capacity units will be DATA TYPES variable, unpredictable traffic → on-deman
new item.
key will determine the partition where
distributed among all internal partitions.
Besides your primary key, your document can contain other variable, predictable traffic → provisione
There are two different types of an item will be stored at.

If your partition keys are not well-distributed, it will be easier fields of different Scalar, Document and Set Types.

steady, predicatable traffic → reserved


primary keys
to get your requests throttled as a subset of your partitions simple - your partition key &
(or worse: a single) can receive the majority of read and/or RETRIEVING ITEMS therefore a single field
SCALAR DOCUMENT SET
}
Partition 1 Partition 2 Partition 3 Partition N
write requests.

Adaptive Capacity
That's where it gets interesting and you composite - a combination of your A good partition key is equally
throughput increase Represented by Complex structure with Multiple scalar values
Provisioned
exactly one value nested attributes String Set (SS see differences to SQL or other NoSQL partition & sort key.
distributed to avoid hot partitions.
Consumed String (S List (L Number Set (NS solutions.

Number (N Map (M) Binary Set (BS)


SORT KEYS
Partition 1 Partition 2 Partition 3 Partition 4
You can only query via your partition key
DynamoDB will increase capacity for hot partitions, as long as the table-level Binary (B
Boolean (BOOL (and sort key condition, if there’s any) of
throughput is not exceeded (Adaptive Capacity).
Using sort keys come in with benefits
Even more awesomeness: If there’s disproportionately high traffic to one or Null (NULL)
your main or secondary indexes.

they can be used with operators in queries such as begins_with, between, >, <, and so on
several items in the same partition, DynamoDB will rebalance partitions such Everything else needs scan.𝘀𝗰𝗮𝗻

that those items don't reside on the same partition. you can create hierarchal (1:n) releationships - citing an example from the docs:

[country]#[region]#[state]#[county]#[city]#[neighborhood]

RACE CONDITIONS SCAN


Often, there are possible race conditions due to multi-

A scan is just running through your table QUERY The combination of a partition & sort key (= your primary key) needs to be unique.
looking for items that are matching your With query, you're only paying for the
tenancy where writes can be lost.

Example
expression.

You'll be charged for the items that are


retrieved items. It's only looking for the
items at a specific partition. So generally
BAC KUPS SECONDARY INDEXES
Lambda A reads Document
likes : } {“ ” []
AWS offers you a lot of options for backing You can create two types of indexes, which
scanned, not the items that are retrieved. speaking: query is way faster and cheaper.
are specifying alternative key structures.
Lambda B reads Document likes : } up your tables
OPTIMISTIC LOCKING
{“ ” []

Lambda A writes Document X


likes : A } {“ ” [“ ”]
On-Demand Backups - trigger backups Those can also be used to query items
Lambda B writes Document X ️
likes : B } {“ ” [“ ”]
DynamoDB’s Optimistic Locking allows us to verify that OBSERVABILITY GLOBAL TABLES manually or via a scheduled event Local Secondary Index (LSI) - needs to
we’re really updating the item we’re expecting by using a CloudWatch comes with default metrics like used read & Distribute your data gobally via Continuous Backups via Point-In-Time- have the same partition key, but an
dedicated version field. write capacity units or the number of throttles. It helps global tables for redundancy and Recovery (PITR) - enables you to restore alternative sort key
UPDATE EXPRESSIONS to analyse DynamoDB traffic patterns so you can faster latencies.
your table to any state with the last 35 Global Secondary Index (GSI) - partition
Safely modify certain fields of a complex document In the previous example, both read operations would read optimise for low costs.

A bi-directional synchronization day & sort key can be different.

SET - adding one or several attributes to an item version 1 and also expect to write version 2. The first Exporting Backups to S3 - export your
Third-party tools like Dashbird.io help you with Slack will replicate your data between
REMOVE - removing one or several attributes operation would succeed, but the second would fail as the
notifications for critical events like throttles & give you different regions. data to an S3 bucket. You can also STREAMS
ADD - adding new attributes with its value expected version
automatically trigger this process via Asynchronously trigger invocations of other
general guidance with

DELETE - remove one or more elements from a set. would not match with
actual state Lambda & EventBridge rules. services like Lambda when an item is
well-architected tips.

the expectations. likes : B , version: 2 }


{“ ” [“ ”]
e pects: version = 1
x
likes : A , version: 2 }
{“ ” [“ ”]
eu-central-1 us-west-2 ap-northeast-1
created, updated or deleted.

update
async stream
contains the item
operation event state before & after
the update operation
NEW_AND_OLD_IMAGES

You might also like