Please enable JavaScript.
Coggle requires JavaScript to display documents.
DynamoDB (Limits (Provisioned Throughput (Auto Scaling possible (Auto…
DynamoDB
Limits
secondary index
max. 5 local
max. 5 global
not allowed to increase :no_entry:
max. 20 projected attributes
Provisioned Throughput
capacity unit
1
read
capacity unit =
1 strongly
consistent
read
/sec
1
read
capacity unit =
2 eventually
consistent
read
/sec
1
write
capacity unit =
1 write
/sec for items
all writes are
max. 1 KB
read capacity chunk is
4KB
round up to 4KB
min. settings
are 1 read unit and 1 write unit
includes the
sum
of the capacity of the
table and all indexes
default limits could be increased by AWS :silhouettes:
if
> 10.000
writes or reads per second
Auto Scaling possible
enabled by AWS Console (checkbox / capacity tab)
enabled by CLI or SDK
min. capacity (is 1 unit)
max. capacity
Auto Scaling policy
can be changed anytime
set to single table or index
within a single region
tables
no size limit
max. 256 tables/region
could be increased by AWS :silhouettes:
partition key
max. length is
2048 bytes
min. 1 byte
sort key
min 1 byte
max. length is
1024 bytes
item collection
grp of items with the same partition key value
max. size is
10GB
Naming rules
names length =
3 - 255 characters
a-z, A-Z, 0-9, _ , -, .
attribute name
must be UTF-8
min. 1 char up to
64KB
/ some 1-
255 char
item
max. length
400KB
unlimited attributes
Features
NoSQL database
key-value store
schemaless
document format
JSON
XML
HTML
scalability
no operating or scaling burden
hardware provision
setup and configuration
replication
accross multiple AZ in a region
patching
cluster scaling
all date is stored on SSD
spread
accross 3
geographically destinct data centres
Consistency Model
evenentual
consistency by
default
strongly consistency possible
high-availability
API Calls
Working with tables
CRUD
UpdateTable
DeleteTable
CreateTable
DescribeTables
table size
state
index information
ListTables
list of all tables/account
Working with items
BatchGetItem
max. 16 MB total retrieved size
retrieve max.
100 items
PutItem
new item
BatchWriteItem
write, replace or delete multiple items
UpdateItem
modfies attributes
DeleteItem
deletes item by primary key
GetItem
returns attributes
Search Operations
Scan
result is limited to
1 MB
per call
will be terminated if limit reached
returns
LastEvaluatedKey
as start for the next scan
full
scan across the table or secondary index
slower than query
as an iterator
Query
result is limited to
1 MB
per call
returns 1 or more items by table PK
supports comparison operators
supports expressions
supports filter on non-key attributes
faster than scan
Reads supports eventlual conistency by
default
ConsistentRead
true = strongly consistency
false = eventual consistency
SDK
document SDK
Wrapper
interoperability between JS and DynamoDB datatypes
working with data
Core Components
item
Time To Live (
TTL
)
contains a collection of
attributes
primary key
two types
Partition key and sort key
:check:
composed of
2 attributes
1st is partition key
2nd is sort key
partition key is
not unique
:warning:
all items with the same partition key are stored togehter and sorted by sort key value
but different sort key values
sometimes sort key called
range attribute
also
Partition key
:check:
Single Attribute
sometimes called
Hash Key
(it is the same) :warning:
partition key is
unique
like
unique ID
to identify items uniquely in a
table
dynamoDB uses pk value inside hash functions to get the
partition
(physical storage)
partition key is called
hash attribute
also
pk value
must be
scalar
allowed data types
string
number
binary
secondary indexes
for more querying flexibility
not required
can read data in the same way as from the table
two types
Global
secondary index
different partition key
from those on the table
different sort key
from those on the table
Local
secondary index
same partition key
as the table
different sort key
table
collection of data
similar to other db systems
contains zero to more
items
items are like a rows or tuples
attribute
a funcamental data element
like
column
data or
fields
most
attributes are
scalar
(only one value)
string
number
some
have
nested
attributes
up to
32 levels
supported
Streams
optional feature
captures data modification events
near real time
enabled on a table
can trigger lambda funtions
events represented by a
stream record
write records for the following events
new item added to table
image of entire item, including all of its attributes
item is updated
"before" and "after" image of any modfied attribute
item is deleted
stream captures the image of the entire item before
additionally contains
table name
timestamp
other metadata
stored for
max. 24h
global tables
sync tables accross regions
encryption
on-demand backup