conhecendo o dynamodb

57
Under the Covers of DynamoDB Sao Paolo

Upload: amazon-web-services-latin-america

Post on 27-Jan-2015

119 views

Category:

Entertainment & Humor


7 download

DESCRIPTION

Conhecendo o DynamoDB

TRANSCRIPT

Page 1: Conhecendo o DynamoDB

Under the Covers of DynamoDB

Sao Paolo

Page 2: Conhecendo o DynamoDB

Vários Tutoriais , treinamentos e mentoria em

português

Inscreva-se agora !!

http://awshub.com.br

Page 3: Conhecendo o DynamoDB

What is

DynamoDB?

1

Page 4: Conhecendo o DynamoDB

DynamoDB is a

managed NoSQL

database service.

Store and retrieve any amount of data.

Serve any level of request traffic.

Page 5: Conhecendo o DynamoDB

Without the operational burden.

Page 6: Conhecendo o DynamoDB

Consistent, predictable performance.

Single digit millisecond latency.

Backed on solid-state drives.

Page 7: Conhecendo o DynamoDB

Key/attribute pairs. No schema required.

Easy to create. Easy to adjust.

Flexible data model.

Page 8: Conhecendo o DynamoDB

No table size limits. Unlimited storage.

No downtime.

Seamless scalability.

Page 9: Conhecendo o DynamoDB

Consistent, disk only writes.

Replication across data centers and availability zones.

Durable.

Page 10: Conhecendo o DynamoDB

Focus on your app.

Page 11: Conhecendo o DynamoDB

Reserve IOPS for reads and writes.

Scale up for down at any time.

Provisioned throughput.

Page 12: Conhecendo o DynamoDB

Pay per capacity unit.

Priced per hour of provisioned throughput.

Page 13: Conhecendo o DynamoDB

Size of item x writes per second

Write throughput.

Page 14: Conhecendo o DynamoDB

Atomic increment and decrement.

Optimistic concurrency control: conditional writes.

Consistent writes.

Page 15: Conhecendo o DynamoDB

Item level transactions only.

Puts, updates and deletes are ACID.

Transactions.

Page 16: Conhecendo o DynamoDB

Read throughput.

Strong or eventual consistency

Page 17: Conhecendo o DynamoDB

Read throughput.

Strong or eventual consistency

Provisioned units = size of item x reads per second

Page 18: Conhecendo o DynamoDB

Read throughput.

Strong or eventual consistency

Provisioned units = size of item x reads per second

2

Page 19: Conhecendo o DynamoDB

Read throughput.

Strong or eventual consistency

Same latency expectations.

Mix and match at ‘read time’.

Page 20: Conhecendo o DynamoDB

Provisioned throughput is managed by DynamoDB.

Page 21: Conhecendo o DynamoDB

Data is partitioned and managed by DynamoDB.

Page 22: Conhecendo o DynamoDB

Tiered bandwidth pricing:

aws.amazon.com/dynamodb/pricing

Indexed data storage.

Page 23: Conhecendo o DynamoDB

Up to 53% for 1 year reservation.

Up to 76% for 3 year reservation.

Reserved capacity.

Page 24: Conhecendo o DynamoDB

Session based to minimize latency.

Uses the Amazon Security Token Service.

Handled by AWS SDKs.

Integrates with IAM.

Authentication.

Page 25: Conhecendo o DynamoDB

CloudWatch metrics:

latency, consumed read and write throughput,

errors and throttling.

Monitoring.

Page 26: Conhecendo o DynamoDB

Libraries, mappers and mocks.

ColdFusion, Django, Erlang, Java, .Net,

Node.js, Perl, PHP, Python, Ruby

http://j.mp/dynamodb-libs

Page 27: Conhecendo o DynamoDB

NoSQL Data

Modeling

2

Page 28: Conhecendo o DynamoDB

id = 100

date =

2012-05-16-12-00-10 id = 101 total = 100.00

total = 25.00

id = 101 date =

2012-05-15-15-00-11 total = 35.00

date =

2012-05-16-09-00-10

Page 29: Conhecendo o DynamoDB

id = 100 date =

2012-05-16-09-00-10 total = 25.00

id = 101 date =

2012-05-15-15-00-11 total = 35.00

Table

date =

2012-05-16-12-00-10 id = 101 total = 100.00

Page 30: Conhecendo o DynamoDB

id = 100 total = 25.00

id = 101 date =

2012-05-15-15-00-11 total = 35.00

Item

date =

2012-05-16-12-00-10 id = 101 total = 100.00

date =

2012-05-16-09-00-10

Page 31: Conhecendo o DynamoDB

id = 100

2012-05-15-15-00-11

total = 25.00 Attribute

date =

2012-05-16-12-00-10 id = 101 total = 100.00

id = 101 date =

total = 35.00

date =

2012-05-16-09-00-10

Page 32: Conhecendo o DynamoDB

Tables do not require a formal schema.

Items are an arbitrarily sized hash.

Where is the schema?

Page 33: Conhecendo o DynamoDB

Items are indexed by primary and secondary keys.

Primary keys can be composite.

Secondary keys are local to the table.

Indexing.

Page 34: Conhecendo o DynamoDB

ID Date Total

Page 35: Conhecendo o DynamoDB

ID Date Total

Hash key

Page 36: Conhecendo o DynamoDB

ID Date Total

Hash key Range key

Composite primary key

Page 37: Conhecendo o DynamoDB

ID Date Total

Hash key Range key Secondary range key

Page 38: Conhecendo o DynamoDB

Programming DynamoDB.

Small but perfectly formed API.

Page 39: Conhecendo o DynamoDB

CreateTable

Scan

UpdateTable

DeleteTable

DescribeTable

ListTables

Query

PutItem

GetItem

UpdateItem

DeleteItem

BatchGetItem

BatchWriteItem

Page 40: Conhecendo o DynamoDB

CreateTable

Scan

UpdateTable

DeleteTable

DescribeTable

ListTables

Query

PutItem

GetItem

UpdateItem

DeleteItem

BatchGetItem

BatchWriteItem

Page 41: Conhecendo o DynamoDB

CreateTable

Scan

UpdateTable

DeleteTable

DescribeTable

ListTables

Query

PutItem

GetItem

UpdateItem

DeleteItem

BatchGetItem

BatchWriteItem

Page 42: Conhecendo o DynamoDB

PutItem, UpdateItem, DeleteItem can take

optional conditions for operation.

UpdateItem performs atomic increments.

Conditional updates.

Page 43: Conhecendo o DynamoDB

One API call, multiple items

BatchGet returns multiple items by key.

BatchWrite performs up to 25 put or delete operations.

Throughput is measured by IO, not API calls.

Page 44: Conhecendo o DynamoDB

CreateTable

UpdateTable

DeleteTable

DescribeTable

ListTables

Query

Scan

PutItem

GetItem

UpdateItem

DeleteItem

BatchGetItem

BatchWriteItem

Page 45: Conhecendo o DynamoDB

Query returns items by key.

Scan reads the whole table sequentially.

Query vs Scan

Page 46: Conhecendo o DynamoDB

Query patterns

Retrieve all items by hash key.

Range key conditions:

==, <, >, >=, <=, begins with, between.

Counts. Top and bottom n values.

Paged responses.

Page 47: Conhecendo o DynamoDB

Example

3

Page 48: Conhecendo o DynamoDB

Players

user_id = mza

location = Cambridge

joined = 2011-07-04

user_id = jeffbarr

location = Seattle

joined = 2012-01-20

user_id = werner

location = Worldwide

joined = 2011-05-15

Page 49: Conhecendo o DynamoDB

Players

Scores

user_id = mza

location = Cambridge

joined = 2011-07-04

user_id = jeffbarr

location = Seattle

joined = 2012-01-20

user_id = werner

location = Worldwide

joined = 2011-05-15

user_id = mza

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = werner

location = bejewelled

score = 55,000

Page 50: Conhecendo o DynamoDB

Players

Scores Leader boards

user_id = mza

location = Cambridge

joined = 2011-07-04

user_id = jeffbarr

location = Seattle

joined = 2012-01-20

user_id = werner

location = Worldwide

joined = 2011-05-15

user_id = mza

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = werner

location = bejewelled

score = 55,000

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = mza

game = tetris

score = 9,000,000

user_id = jeffbarr

Page 51: Conhecendo o DynamoDB

Players

Scores Leader boards

Query for scores by user

user_id = mza

location = Cambridge

joined = 2011-07-04

user_id = jeffbarr

location = Seattle

joined = 2012-01-20

user_id = werner

location = Worldwide

joined = 2011-05-15

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = mza

game = tetris

score = 9,000,000

user_id = jeffbarr

user_id = mza

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = werner

location = bejewelled

score = 55,000

Page 52: Conhecendo o DynamoDB

Players

Scores Leader boards

High scores by game

user_id = mza

location = Cambridge

joined = 2011-07-04

user_id = jeffbarr

location = Seattle

joined = 2012-01-20

user_id = werner

location = Worldwide

joined = 2011-05-15

user_id = mza

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = werner

location = bejewelled

score = 55,000

game = angry-birds

score = 11,000

user_id = mza

game = tetris

score = 1,223,000

user_id = mza

game = tetris

score = 9,000,000

user_id = jeffbarr

Page 53: Conhecendo o DynamoDB

Customer

Success

4

Page 54: Conhecendo o DynamoDB

• O IBOPE é a maior empresa privada de pesquisa da América Latina e a 12ª maior do mundo;

• Amplamente presente no território brasileiro, a empresa tem filiais nos Estados Unidos e em 13 países da América Latina;

• Por ser um provedor de informações e conhecimento, a tecnologia é fundamental para o suporte aos produtos oferecidos pelo IBOPE.

“A utilização do AWS permitiu o desenvolvimento da

solução sem grande investimento inicial em CAPEX, além

de possibilitar flexibilidade na expansão da infraestrutura.”

“A AWS é ideal quando os recursos

necessários são incertos ou não

podem ser previstos com precisão.”

Page 55: Conhecendo o DynamoDB

O Desafio

• O desafio do IBOPE era desenvolver um sistema para monitoramento dos principais portais de internet para coletar as peças publicitárias apresentadas e, com isso, prover informações referentes ao investimento publicitário em internet aos seus clientes;

• Permitir a coleta de grande quantidade de dados de forma rápida e escalável;

• Permitir o crescimento para outras operações do grupo em outros países.

Page 56: Conhecendo o DynamoDB

Sobre a o Papel da AWS e Benefícios

alcançados

PARAGRAFO

RESUMO CASO _

KEY WORDS de

BENEFICIO,

DESAFIO VENCIDO

– RESUMO DO

CASO EM UM

PARAGRAFO

• Motivos para escolha do AWS:

• Incertezas com relação ao volume de dados a ser capturado;

• Poder crescer e reduzir rapidamente a infraestrutura;

• Possibilidade de, no futuro, trabalhar com o autoscale;

• Alta disponibilidade dos serviços.

• Benefícios

• Administração simples e fácil;

• Maior disponibilidade e performance das aplicações;

• Escalabilidade;

• Desempenho rápido.

Page 57: Conhecendo o DynamoDB

Thank you. Questions?

Learn More:

aws.amazon.com/dynamodb