Dynamo db
-
Upload
andy-dai -
Category
Technology
-
view
1.621 -
download
2
Transcript of Dynamo db
DynamoDB
13年9月22⽇日星期⽇日
What is DynamoDB
• 讓我們來看一段官方介紹影片
13年9月22⽇日星期⽇日
What is DynamoDB
• Managed NoSQL database service
• Features
• Schemaless
• Fast - SSD
•Reserved IOPS for R/W
13年9月22⽇日星期⽇日
Data Model
• Table - collection of items
• Items - Any number of attributes, up to 64k
13年9月22⽇日星期⽇日
Data Model
• No schema - Just provide PK
• Items are indexed by PK
• Single hash key & composite key
13年9月22⽇日星期⽇日
Working with Tables
• Specifying PK
• Hash PK - ex. ProductID
• Hash and Range PK - ex. ForumName and Subject
• Specifying Read/Write requirements
13年9月22⽇日星期⽇日
R/W Requirements
• Read capacity units
• Strongly consistent read per second of items up to 4KB
13年9月22⽇日星期⽇日
R/W Requirements
• Write capacity units
• The number of 1KB writes per second
13年9月22⽇日星期⽇日
Pricing
• Based on Provisioned Throughput Capacity + Indexed Storages
13年9月22⽇日星期⽇日
Working with Items
• Documentations
13年9月22⽇日星期⽇日
Index
13年9月22⽇日星期⽇日
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⽇日星期⽇日
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⽇日星期⽇日
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⽇日星期⽇日
Reference
• Getting Started
• Local Secondary Index
• Best Practice
13年9月22⽇日星期⽇日
DEMO
13年9月22⽇日星期⽇日
When to use DynamoDB?
• If your application can fit into DynamoDB...
• If you hate to tune the database...
13年9月22⽇日星期⽇日