nosql: perdas e ganhos

42
NoSQL: Perdas e Ganhos Mauricio De Diana [email protected]

Upload: mauricio-de-diana

Post on 25-May-2015

2.660 views

Category:

Technology


2 download

DESCRIPTION

Apresentação no TDC2010 (21/08).

TRANSCRIPT

Page 1: NoSQL: Perdas e Ganhos

NoSQL: Perdas e Ganhos Mauricio De Diana

[email protected]

Page 2: NoSQL: Perdas e Ganhos

Arquitetura

Page 3: NoSQL: Perdas e Ganhos

Trade-offs LatênciaVazãoSegurança...ManutenibilidadeTestabilidade

Page 4: NoSQL: Perdas e Ganhos

Modelo de dados Performance / Escalabilidade

Page 5: NoSQL: Perdas e Ganhos

NOSQL: scaling to size and scaling to complexityhttp://blogs.neotechnology.com/emil/2009/11/nosql-scaling-to-size-and-scaling-to-complexity.html

Page 6: NoSQL: Perdas e Ganhos
Page 7: NoSQL: Perdas e Ganhos

Bigtable "Bigtable is a distributed storage system for managing

structured data that is designed to scale to a very large size:

petabytes of data across thousands of commodity servers."

Bigtable: A Distributed Storage System for Structured Data [2006]

Page 8: NoSQL: Perdas e Ganhos

Dynamo

"Reliability at massive scale is one of the biggest challenges we face at Amazon.com [...]. The Amazon.com platform [...] is implemented on top of an infrastructure of

tens of thousands of servers and network

components located in many datacenters around the world."

Dynamo: Amazon's Highly Available Key-value Store [2007]

Page 9: NoSQL: Perdas e Ganhos

Modelo de dados

Page 10: NoSQL: Perdas e Ganhos

Modelo mais adequado

Impedância Objeto-Relacional Grafos: interconectividade dos dados é tão ou mais importante quanto os dados em si Modelos simples: chave-valor

Page 11: NoSQL: Perdas e Ganhos

Relacional

Esquema Restrições de integridade (pks, fks, tipos e valores) Normalização

Page 12: NoSQL: Perdas e Ganhos

NoSQL and SQL Anti Patterns

Dynamic table creation

Row alignment

Extreme joins

http://www.slideshare.net/gleicon/nosql-and-sql-anti-patterns

Page 13: NoSQL: Perdas e Ganhos

Dados semi-estruturados

Estrutura heterogênea

Estrutura parcial

Esquemas que evoluem rapidamente

Distinção pouco clara entre esquema e dados

Page 14: NoSQL: Perdas e Ganhos

Shared Database

http://www.eaipatterns.com/SharedDataBaseIntegration.html

Page 15: NoSQL: Perdas e Ganhos

Performance / Escalabilidade

Page 16: NoSQL: Perdas e Ganhos

Escalar relacional

Page 17: NoSQL: Perdas e Ganhos

N web servers1 db

Page 18: NoSQL: Perdas e Ganhos

master / slave

Page 19: NoSQL: Perdas e Ganhos

master / slave

Page 20: NoSQL: Perdas e Ganhos

functional partitioning

Page 21: NoSQL: Perdas e Ganhos

sharding

Page 22: NoSQL: Perdas e Ganhos

JoinsIntegridade referencialAuto-increment Normalização

e ainda carrega todo o peso de um RDMBS

Page 23: NoSQL: Perdas e Ganhos

One size fits all?

"One Size Fits All": An Idea Whose Time Has Come and Gone [2005]

Page 24: NoSQL: Perdas e Ganhos

One size does not fit all

OLTP

Operação

CRUD pequeno e rápido

Queries simples

OLAP

Informação (BI)

Batches demorados

Queries complexas

Page 25: NoSQL: Perdas e Ganhos

One size does not fit all

OLTP

H-Store

OLAP

C-Store

The End of an Architectural Era (It's Time for a Complete Rewrite) [2007]C-store: a Column-oriented DBMS [2005]

Page 26: NoSQL: Perdas e Ganhos

Atomicidade

Consistência

Isolamento

Durabilidade

Transações

Page 27: NoSQL: Perdas e Ganhos

Teorema CAP

Consistency

Availability

Partition Tolerance

Towards Robust Distributed Systems [2000]Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-tolerant Web Services [2002]

Page 28: NoSQL: Perdas e Ganhos

ACID x BASE

Basically Available

Soft state

Eventual consistency

BASE: An Acid Alternative [2008]Eventually Consistent [2009]

Page 29: NoSQL: Perdas e Ganhos

eventual en

Occurring at an unspecified time in the future

Dependente de acontecimento incerto; casual; fortuito; possível mas incerto.

eventual ptX

Page 30: NoSQL: Perdas e Ganhos
Page 31: NoSQL: Perdas e Ganhos
Page 32: NoSQL: Perdas e Ganhos
Page 33: NoSQL: Perdas e Ganhos
Page 34: NoSQL: Perdas e Ganhos
Page 35: NoSQL: Perdas e Ganhos
Page 36: NoSQL: Perdas e Ganhos
Page 37: NoSQL: Perdas e Ganhos
Page 38: NoSQL: Perdas e Ganhos
Page 39: NoSQL: Perdas e Ganhos

Workarounds

Não fazer nada Ações de compensação

Starbucks Does Not Use Two-Phase Commithttp://www.eaipatterns.com/ramblings/18_starbucks.html

Page 40: NoSQL: Perdas e Ganhos

Polyglot persistence

Page 41: NoSQL: Perdas e Ganhos
Page 42: NoSQL: Perdas e Ganhos

Obrigado

[email protected]