Dynamo Db

January 16, 2017 | Author: 21ignis | Category: N/A
Share Embed Donate


Short Description

Download Dynamo Db...

Description

Four Tips for Faster Development with DynamoDB David Pearson Business Development Manager AWS Database Services

AWS Database Services Amazon RDS

Amazon ElastiCache

Amazon DynamoDB

Amazon Redshift

Scalable High Performance Application Storage in the Cloud Deployment & Administration Application Services

Compute

Storage

Database

Networking AWS Global Infrastructure

Scaling Databases

RDBMS

infrastructure scaling + application scaling

 Read Replicas  Data Sharding  Denormalization

NoSQL

infrastructure scaling only

Amazon’s Database Journey DynamoDB RDBMS

distributed

= key/value

database service

massively scalable

distributed

= key/value

database service predictable performance automated operations durable low latency cost effective

simple API fast development

table item

attribute

table item

attribute

primary key is unique 1. hash only

hash key

mandatory

table item

attribute

primary key is unique 1. hash only 2. hash + range

hash range key key

optional

table item

attribute attributes are associated with items rather than tables (as in RDBMS)

hash range key key

sparse schema

Faster Development Customer Experiences Weatherbug mobile app

Super Bowl promotion

Lightning detection & alerting for 40M users/month

Millions of interactions over a relatively short period of time

Developed and tested in weeks, at “1/20th of the cost of the traditional DB approach”

Built the app in 3 days, from design to production-ready

Faster Development

Four Tips design for scale leverage range keys use libraries & tools develop & test locally

Design for Scale Common Problem = inefficiently designed schemas  Hot spots create premature throttling  Excessive payloads cost more to move

Design Goals: • Optimize the schema to the access patterns • Minimize multi-table fetches (for high-scale patterns) • Minimize payload size for each pattern

Design for Scale – Partitioning • DynamoDB automatically partitions data by the hash key  Hash key spreads data (& workload) across partitions

• Auto-partitioning driven by:

table

 Data set size  Throughput provisioned large number of unique hash keys

ready to scale!

+ uniform distribution of workload across hash keys

partitions 1 .. N

Design for Scale – Efficient Schema Design 1. Identify the individual access patterns 2. Model each pattern to its own discrete data set 3. Consolidate data sets into tables and indexes Abbreviated Example: File Sharing Access Patterns given userid… • return all items by file name • return all items by date created • return all items by size • return all items by type • return all items by date updated

Range Keys • Enable modeling 1:M relationships hash

range

attributes

userid=“@mza”

postdate=“201309-12T20:59:28Z”

posttext=“New! Develop and test your apps with DynamoDB Local: http://aws.typepad.com/aws/2013/09/dynamodb-local-for-desktop-development.html … #aws”

userid=“@mza”

postdate=“201309-13T09:17:37Z”

posttext=“Also! Copy DynamoDB data between regions with Data Pipeline: http://aws.typepad.com/aws/2013/09/copy-dynamodb-data-between-regions-using-the-awsdata-pipeline.html … #aws”

userid=“@werner”

postdate=“201310-04T17:41:09Z”

posttext=“cool! RT @dialtone_: Worldwide DynamoDB replication for billions of rows a day? No problem! http://tech.adroll.com/blog/ops/2013/10/02/dynamodb-replication.html … @AdRoll can handle that!”

Range Keys – Simple API • Currently 13 operations in total Read and Write Items

Manage Tables • • • • •

CreateTable UpdateTable DeleteTable DescribeTable ListTables

• • • •

PutItem GetItem UpdateItem DeleteItem

Read and Write Multiple Items • • • •

BatchGetItem BatchWriteItem Query Query Scan

Range Keys – Query Query

• • • • •

Available for hash+range primary key tables Retrieve all items by hash key Range key conditions: ==, , >=,
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF