View
112
Download
7
Tags:
Embed Size (px)
DESCRIPTION
Conhecendo o DynamoDB
Citation preview
Under the Covers of DynamoDB
Sao Paolo
Vários Tutoriais , treinamentos e mentoria em
português
Inscreva-se agora !!
http://awshub.com.br
What is
DynamoDB?
1
DynamoDB is a
managed NoSQL
database service.
Store and retrieve any amount of data.
Serve any level of request traffic.
Without the operational burden.
Consistent, predictable performance.
Single digit millisecond latency.
Backed on solid-state drives.
Key/attribute pairs. No schema required.
Easy to create. Easy to adjust.
Flexible data model.
No table size limits. Unlimited storage.
No downtime.
Seamless scalability.
Consistent, disk only writes.
Replication across data centers and availability zones.
Durable.
Focus on your app.
Reserve IOPS for reads and writes.
Scale up for down at any time.
Provisioned throughput.
Pay per capacity unit.
Priced per hour of provisioned throughput.
Size of item x writes per second
Write throughput.
Atomic increment and decrement.
Optimistic concurrency control: conditional writes.
Consistent writes.
Item level transactions only.
Puts, updates and deletes are ACID.
Transactions.
Read throughput.
Strong or eventual consistency
Read throughput.
Strong or eventual consistency
Provisioned units = size of item x reads per second
Read throughput.
Strong or eventual consistency
Provisioned units = size of item x reads per second
2
Read throughput.
Strong or eventual consistency
Same latency expectations.
Mix and match at ‘read time’.
Provisioned throughput is managed by DynamoDB.
Data is partitioned and managed by DynamoDB.
Tiered bandwidth pricing:
aws.amazon.com/dynamodb/pricing
Indexed data storage.
Up to 53% for 1 year reservation.
Up to 76% for 3 year reservation.
Reserved capacity.
Session based to minimize latency.
Uses the Amazon Security Token Service.
Handled by AWS SDKs.
Integrates with IAM.
Authentication.
CloudWatch metrics:
latency, consumed read and write throughput,
errors and throttling.
Monitoring.
Libraries, mappers and mocks.
ColdFusion, Django, Erlang, Java, .Net,
Node.js, Perl, PHP, Python, Ruby
http://j.mp/dynamodb-libs
NoSQL Data
Modeling
2
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
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
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
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
Tables do not require a formal schema.
Items are an arbitrarily sized hash.
Where is the schema?
Items are indexed by primary and secondary keys.
Primary keys can be composite.
Secondary keys are local to the table.
Indexing.
ID Date Total
ID Date Total
Hash key
ID Date Total
Hash key Range key
Composite primary key
ID Date Total
Hash key Range key Secondary range key
Programming DynamoDB.
Small but perfectly formed API.
CreateTable
Scan
UpdateTable
DeleteTable
DescribeTable
ListTables
Query
PutItem
GetItem
UpdateItem
DeleteItem
BatchGetItem
BatchWriteItem
CreateTable
Scan
UpdateTable
DeleteTable
DescribeTable
ListTables
Query
PutItem
GetItem
UpdateItem
DeleteItem
BatchGetItem
BatchWriteItem
CreateTable
Scan
UpdateTable
DeleteTable
DescribeTable
ListTables
Query
PutItem
GetItem
UpdateItem
DeleteItem
BatchGetItem
BatchWriteItem
PutItem, UpdateItem, DeleteItem can take
optional conditions for operation.
UpdateItem performs atomic increments.
Conditional updates.
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.
CreateTable
UpdateTable
DeleteTable
DescribeTable
ListTables
Query
Scan
PutItem
GetItem
UpdateItem
DeleteItem
BatchGetItem
BatchWriteItem
Query returns items by key.
Scan reads the whole table sequentially.
Query vs Scan
Query patterns
Retrieve all items by hash key.
Range key conditions:
==, <, >, >=, <=, begins with, between.
Counts. Top and bottom n values.
Paged responses.
Example
3
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
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
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
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
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
Customer
Success
4
• 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.”
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.
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.
Thank you. Questions?
Learn More:
aws.amazon.com/dynamodb