Monday, February 27, 2017

Dynamo DB


1) Dynamodb is a Fully managed NoSQL. Fast predictable with semaless scalablity

2) All the Data's are stores in SSD's and replicated across multiple AZ's providing built in HA and durablity

3) Components – Tables, items and Attribute

4) Each item in the table has a unique ID or primary key

5) Supports two types of primary key
           (i)  Simple (Partition key)
           (ii) Complex (Partition Key & Sort Key)

6) Supports two types of Index
           (i)  Local secondary index
           (ii) Global secondary index
7) Every index belong to a table called base table

8) Types of read
            (i)  Strong Consistent reads
            (ii) Eventual consistent reads ( Default )


Read and Write capacity units calculation

Read Capacity Units

If your items are smaller than 4KB in size, each read capacity unit will yield one strongly consistent read per second or two eventual consistent reads per second.

Eg 1: Suppose that you want to read 80 items per second from a table and the items are in 3KB size. Then let us see how to calculate the read capacity units. 

Divide the item size of the operation by 4 KB, and then round up to the nearest whole number, as shown below.

3KB/4KB = 0.75  --> 1

So For 80 items 80 X 1 - 80  (So, 80 Units for strong consistent read and 40 for eventual consistent read)

Eg 2:  Calculate the capacity units for a item of  size 10KB and  and for 5 Items.

Divide the item size by 4
10/4(KB) = 2.5 --> 3 

Multiply the Capacity unit with the number of items to get the capacity units for total number of items

3 X 5 -  15 (15 for Strong consistent read and 8 for Eventual consistent read)

Write Capacity Units

In the previous topic we have seen how to calculate read capacity unit. Now will see how to calculate write capacity unit. If your items are smaller than 1KB in size, each write capacity unit will yield one write Per/Sec

Eg 1 : If you want to read 100 items of size 512 bytes. then below is the calculation.

512 Bytes/1 KB = 0.5 --> 1

1 X 100 - 100 Write capacity units

Eg 2 : Let us take second case, where item size is 1.5 Kb and number of items is 10. Then below is the calculation

1.5/1(KB) =1.5 --> 2

For the final number of capacity units, multiply with the value for 1. 2 X 10 - 20 Write capacity units

Limits

1) 5 Global and 5 Local index per table
2) Attribute limit – 64 kb
3) Batch item – 16 MB
4) Total size of item -400 KB
5) Partition key length – 1 byte to 2048 bytes
6) Throughput – Per table      – US East – 40,000 other region's - 10,000
                         Per Account – US East  80,000 other region's -  20,000

Supported Data – Number,  String, Binary & Boolean

Note: Empty string not allowed as a valid attribute

No comments:

Post a Comment