nosql: perdas e ganhos
DESCRIPTION
Apresentação no TDC2010 (21/08).TRANSCRIPT
NoSQL: Perdas e Ganhos Mauricio De Diana
Arquitetura
Trade-offs LatênciaVazãoSegurança...ManutenibilidadeTestabilidade
Modelo de dados Performance / Escalabilidade
NOSQL: scaling to size and scaling to complexityhttp://blogs.neotechnology.com/emil/2009/11/nosql-scaling-to-size-and-scaling-to-complexity.html
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]
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]
Modelo de dados
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
Relacional
Esquema Restrições de integridade (pks, fks, tipos e valores) Normalização
NoSQL and SQL Anti Patterns
Dynamic table creation
Row alignment
Extreme joins
http://www.slideshare.net/gleicon/nosql-and-sql-anti-patterns
Dados semi-estruturados
Estrutura heterogênea
Estrutura parcial
Esquemas que evoluem rapidamente
Distinção pouco clara entre esquema e dados
Shared Database
http://www.eaipatterns.com/SharedDataBaseIntegration.html
Performance / Escalabilidade
Escalar relacional
N web servers1 db
master / slave
master / slave
functional partitioning
sharding
JoinsIntegridade referencialAuto-increment Normalização
e ainda carrega todo o peso de um RDMBS
One size fits all?
"One Size Fits All": An Idea Whose Time Has Come and Gone [2005]
One size does not fit all
OLTP
Operação
CRUD pequeno e rápido
Queries simples
OLAP
Informação (BI)
Batches demorados
Queries complexas
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]
Atomicidade
Consistência
Isolamento
Durabilidade
Transações
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]
ACID x BASE
Basically Available
Soft state
Eventual consistency
BASE: An Acid Alternative [2008]Eventually Consistent [2009]
eventual en
Occurring at an unspecified time in the future
Dependente de acontecimento incerto; casual; fortuito; possível mas incerto.
eventual ptX
Workarounds
Não fazer nada Ações de compensação
Starbucks Does Not Use Two-Phase Commithttp://www.eaipatterns.com/ramblings/18_starbucks.html
Polyglot persistence
Obrigado