dynamo db & rds deep dive - aws india summit 2012

88
Amazon DynamoDB and Amazon RDS Deep Dive Sundar Raghavan raghavas@amazon

Upload: amazon-web-services

Post on 26-Jan-2015

106 views

Category:

Technology


1 download

DESCRIPTION

Dynamo DB & RDS Deep Dive from the AWS Summit in India. Sundar Raghavan presenting.

TRANSCRIPT

Page 1: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon DynamoDB and Amazon RDS Deep Dive

Sundar Raghavan

raghavas@amazon

Page 2: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Provides real-time weather updates

Scales to millions of users

Makes video gamers happy

Delivers billions of page flips

How?

Page 3: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Provides real-time weather updates

Scales to millions of users

Makes video gamers happy

Amazon RDS

Amazon DynamoDB

Delivers billions of page flips

Page 4: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

YesSQL? NoSQL?

(Hint) Focus on your App

Page 5: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Factors YesSQL (RDS) NoSQL (DynamoDB)

Application • App with complex business logic? • Web app with lots of users?

Transactions • Complex txns, joins, updates? • Simple data model, updates, queries?

Scale • Developer managed • Automatic, on-demand scaling

Performance • Developer architected • Consistent, high performance at scale

Availability • Architected for fail-over • Seamless and transparent

Skills • Relational + Web expertise • Web expertise

Best of both worlds: Use SQL and NoSQL models in one app

Page 6: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Focus on your App with Amazon DynamoDB

Page 7: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon DynamoDB

Quick overview

Page 8: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

DynamoDB is a managedNoSQL database service.Store and retrieve any amount of data.Serve any level of request traffic.

Without any operational burden.

Page 9: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Consistent, predictableperformance.

Single digit millisecond latencies.Backed on solid-state drives.

Page 10: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Flexible data model

Key/attribute pairs. No schema required.

Easy to create. Easy to adjust.

Page 11: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Seamless scalability

No table size limits. Unlimited storage.

No downtime.

Page 12: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

DurableConsistent, disk-only writes (not memory)

Replication across data centres andavailability zones.

Page 13: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Without the operational burden.

FOCUS ON YOUR APP

Page 14: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

November traffic at Amazon.com

76%

24%

Page 15: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Actual traffic

Capacity we can provision with DynamoDB

Capacity we needed before DynamoDB

Page 16: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + three clicks = ready for use

Page 17: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + three clicks = ready for use

Primary keys +

Provisioned level of throughput (easy to change)

Page 18: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

id = 100 date = 2012-05-16-09-00-10 total = 25.00

id = 101 date = 2012-05-16-09-00-11 total = 50.00

Item (max size 64k, collection of attributes)

Order Table (collection of items)

Attribute (key value pair)String – unicode, utf8 binaryNumber – 38 digit precision

Hash Key Range Key

Page 19: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Items are indexed by primary keySingle hash keys and composite keys.

Page 20: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Think of database operations as reads and writes

Item update = 2 reads and 1 writeItem insert = 1 write

Item read = 1 read

Page 21: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Provisioned throughput

Reserve IOPS for reads and writes.

Scale up (or down) at any time.

Priced per hour of provisioned throughput.

Page 22: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Provisioned throughputWrite throughput units = item size * writes/sec$0.01 per hour for 10 write units

Read throughput units = item size * ½ * reads/sec$0.01 per hour for 100 read units

Page 23: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Consistent writes

Atomic increment/decrement.

Optimistic concurrency control.

aka: “conditional writes”.

Page 24: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Transactions

Item level transactions only.

Puts, updates and deletes are ACID.

Page 25: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Read throughput

$0.01 per hour for 50 read units

Provisioned units = size of item x reads/second

strongly consistent

eventually consistent

Page 26: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Read throughput

Mix and match at “read time”.

Same latency expectations.

strongly consistent

eventually consistent

Page 27: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + three clicks = ready for use

Page 28: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 29: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 30: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 31: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + three clicks = ready for use

Page 32: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + one API call = ready for use

Page 33: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

$create_response = $dynamodb->create_table(array( 'TableName' => 'ProductCatalog', 'KeySchema' => array( 'HashKeyElement' => array( 'AttributeName' => 'Id', 'AttributeType' => AmazonDynamoDB::TYPE_NUMBER ) ), 'ProvisionedThroughput' => array( 'ReadCapacityUnits' => 10, 'WriteCapacityUnits' => 5 )));

Page 34: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + one API call = ready for use

Page 35: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + one API call = ready for development

Page 36: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + one API call = ready for production

Page 37: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Two decisions + one API call = ready for scale

Page 38: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 39: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

AuthenticationSession based to minimize latency.Uses Amazon Security Token Service.Handled by AWS SDKs.

Integrates with IAM.

Page 40: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Monitoring

CloudWatch metrics: latency, consumed read and write throughput, errors and throttling.

Page 41: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Libraries, mappers & mocks

http://j.mp/dynamodb-libs

ColdFusion, Django, Erlang, Java, .Net,Node.js, Perl, PHP, Python, Ruby

Page 42: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Ma, I lost my schema!Tables do not require a formal schema.Items are an arbitrary sized hash.Just need to specify the primary key.

(And I can’t find my joins)

Page 43: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Programming DynamoDB

Small but perfectly formed.

Whole programming interface fits on one slide.

Page 44: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

CreateTable

UpdateTable

DeleteTable

DescribeTable

ListTables

PutItem

GetItem

UpdateItem

DeleteItem

BatchGetItem

BatchWriteItem

Query

Scan

Manage tables

Query specific items OR scan the full table

“Select”, “insert”, “update” items

Bulk select or update (max 1MB)

Page 45: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Query patterns

Retrieve all items by hash key.

Range key conditions: ==, <, >, >=, <=, begins with, between.

Counts. Top and bottom n values.Paged responses.

Page 46: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Modeling patterns

Page 47: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

1. Mapping relationships with range keys.

No cross-table joins in DynamoDB.

Use composite keys to model relationships.

Page 48: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

2. Handling large items.

Unlimited attributes per item.Unlimited items per table.

Max 64k per item.

Page 49: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Store a pointer to objects in Amazon S3

Large data stored in S3.Location stored in DynamoDB.99.999999999% data durability in S3.

Page 50: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

3. Managing secondary indices.Not currently supported by DynamoDB.

You can create on your own.

Page 51: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

4. Time series data.Logging, click through, ad views, game play data, application usage.Non-uniform access patterns.Newer data is ‘live’.Older data is read only.

Page 52: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Hot and cold tables.

Jan April MayFeb Mar

higher throughput

lower throughput

Dec

Page 53: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon CloudDrive

• Stores user objects in Cloud– Metadata in DynamoDB– Objects in S3

• Queries and object searches are served by DynamoDB– What are all the objects in my drive?– Find me all the music albums stored on my drive

“We were excited by how fast we were able to put DynamoDB into production and how much developer time we saved. In addition, DynamoDB lets us scale up and down easily by simply reserving increased throughput capacity when we need it and dialing it back when we don’t”

- Russel Dicker, Amazon CloudDrive

Page 54: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

DynamoDB Customer Highlights

Page 55: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Focus on your App with Amazon RDS

Page 56: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Application tier

Load balancer

Database tier

Page 57: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Application tier

Load balancer

Database tier

Spend less time managing this

Invest more time making this innovative

Page 58: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Frequent server upgrades

Storage upgrades

Backup and recovery

Software upgrades

Patching

Hardware crash

Query construction

Query optimization

Configuration

Migration

Schema design

Page 59: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Schema design

Frequent server upgrades

Storage upgrades

Backup and recovery

Software upgrades

Patching

Hardware crash

Query construction

Query optimization

Configuration

Migration

Off load the “muck”

Focus on the “buck”

Page 60: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Backup, recoveryload and unload

Security planning

License training

Script automation

Installation, upgrade, patching, migration

Performance and tuning

Source: Forrester

Page 61: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon RDS

Quick introduction

Relational Database Service

Page 62: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon RDS Overview

Amazon RDS is a fully managed relational database service.

Simple to deploy

Easy to operate and scale

Reliable

Cost effective

Choice of Database engines

Page 63: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Choice of database engines

MySQL

Oracle

Microsoft SQL Server

Page 64: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for use

Page 65: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for use

Database engine +

Instance size & storage +

AvailabilityEasy to change

Page 66: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for use

Database engine +

Instance size & storage +

AvailabilityEasy to change

Page 67: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 68: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 69: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 70: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for use

Page 71: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for development

Page 72: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for scale

Page 73: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three decisions + a few clicks = ready for production

Page 74: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Three ways to remove the “muck”

Page 75: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Productivity

Performance

Data Protection

Page 76: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Productivity

Most admin tasks are managed by RDS

Provisioning

Database backups

Patching

Performance management

Page 77: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Database snapshots

Automatic

Point in time recovery

Faster time to recover

Productivity

Page 78: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Multiple databases per instance

Standard user accounts

Connect and query using common MySQL tools & drivers

Tune engine parameters Import and export data using standard MySQL tools

(mysqldump) Diagnostics

Native MySQL replication

SSL for encryption over the wire

Monitor metrics

Shell, super user or direct file system access (Think security!)

Productivity

Page 79: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Near zero administration

Painless patching, automatic upgrades

Cloudwatch monitoring, Metric alarms

One click. High Availability.

Productivity

Page 80: Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Page 81: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

One click. High availability with Multi-AZ

Automated deployment across multiple AZs

Synchronous replication from master to replica

Automatic fail-over; replica promoted to master

Productivity

Test fail-over

Page 82: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Push-button scale, high performance

Scale storage from 5Gb to 1Tb of storage

Scale instance from small to 4XL (better I/O)

Add read replicas with asynchronous replication

Performance

Add ElastiCache for performance

Page 83: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon ElastiCache

In-memory cache service

Ideal front end to RDS for read-heavy applications

Low latency

Performance

Page 84: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Painless data protection

Daily database back-ups (save up to 35 days)

Snapshot any time. Point in time restore-use innodbRecover everything up to final 5 minutes-innodb!

Data Protection

VPC, SSL, DB Security groups

Page 85: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Samsung saved $34M

Problem:

• Needed to reduce IT costs and were looking to

create a more flexible IT environment

Solution:

• AWS and RDS services. With every request, the

application authenticates devices, delivers apps

and content, and pushes notifications.

Business Benefits:

• Saved $34M in hardware and maintenance

expenses, 85% less than running on-premises

Page 86: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

YesSQL NoSQL

Focus on your App

Page 87: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Amazon RDS Customer Highlights

Gaming Web Apps Mobile/Social Media

Page 88: Dynamo DB & RDS Deep Dive - AWS India Summit 2012

Thank you

raghavas@amazon

aws.amazon.com/dynamodb

aws.amazon.com/rds

Free tier or Free trial