dynamo db

17
DynamoDB 13年9月22星期

Upload: andy-dai

Post on 10-May-2015

1.621 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Dynamo db

DynamoDB

13年9月22⽇日星期⽇日

Page 2: Dynamo db

What is DynamoDB

• 讓我們來看一段官方介紹影片

13年9月22⽇日星期⽇日

Page 3: Dynamo db

What is DynamoDB

• Managed NoSQL database service

• Features

• Schemaless

• Fast - SSD

•Reserved IOPS for R/W

13年9月22⽇日星期⽇日

Page 4: Dynamo db

Data Model

• Table - collection of items

• Items - Any number of attributes, up to 64k

13年9月22⽇日星期⽇日

Page 5: Dynamo db

Data Model

• No schema - Just provide PK

• Items are indexed by PK

• Single hash key & composite key

13年9月22⽇日星期⽇日

Page 6: Dynamo db

Working with Tables

• Specifying PK

• Hash PK - ex. ProductID

• Hash and Range PK - ex. ForumName and Subject

• Specifying Read/Write requirements

13年9月22⽇日星期⽇日

Page 7: Dynamo db

R/W Requirements

• Read capacity units

• Strongly consistent read per second of items up to 4KB

13年9月22⽇日星期⽇日

Page 8: Dynamo db

R/W Requirements

• Write capacity units

• The number of 1KB writes per second

13年9月22⽇日星期⽇日

Page 9: Dynamo db

Pricing

• Based on Provisioned Throughput Capacity + Indexed Storages

13年9月22⽇日星期⽇日

Page 11: Dynamo db

Index

13年9月22⽇日星期⽇日

Page 12: Dynamo db

Query

• A Query operation directly accesses items from a table using the table primary key, , or from an index using the index key.

• Example

13年9月22⽇日星期⽇日

Page 13: Dynamo db

Scan

• The Scan operation returns one or more items and item attributes by accessing every item in the table. To have Amazon DynamoDB return fewer items, you can provide a ScanFilter.

• Example

13年9月22⽇日星期⽇日

Page 14: Dynamo db

Query & Scan cost

• For Query, all items returned are treated as a single read operation. As a result, Amazon DynamoDB computes the total size of all items and then rounds up to the next 4 KB boundary.

• In the case of a Scan operation, Amazon DynamoDB considers the size of the items that are evaluated.

13年9月22⽇日星期⽇日

Page 16: Dynamo db

DEMO

13年9月22⽇日星期⽇日

Page 17: Dynamo db

When to use DynamoDB?

• If your application can fit into DynamoDB...

• If you hate to tune the database...

13年9月22⽇日星期⽇日