+ All Categories
Home > Technology > NoSQL in Perspective

NoSQL in Perspective

Date post: 17-May-2015
Category:
Upload: jeff-smith
View: 670 times
Download: 5 times
Share this document with a friend
Popular Tags:
28
NoSQL in Perspective Jeff Smith [email protected]
Transcript
Page 1: NoSQL in Perspective

NoSQL in Perspective

Jeff Smith [email protected]

Page 2: NoSQL in Perspective

NoSQL on Wikipedia

92 databases 8 types 6 sub-types

Page 3: NoSQL in Perspective

Easy Questions

Is this a graph? Do I already have XML or JSON? Is this a caching problem?

Page 4: NoSQL in Perspective

Paul Graham on Programming Languages

Lisp

C

Page 5: NoSQL in Perspective

Math Problem

Lisp is just math. Math doesn't get stale. What in databases is just math?

Page 6: NoSQL in Perspective

Putting the R in RDBMSes

Relation

Attributes

Tuples

Page 7: NoSQL in Perspective

Database Analogy

C is to Lisp as Relational Algebra is to Relational Calculus

C: Lisp::Relational Algebra: Relational Calculus

Page 8: NoSQL in Perspective

Relational Algebra in Action

Relational Algebra:

SQL:

R ⋉S = { t : t R, s S, Fun (t s) }

SELECT * FROM audience WHERE clue > 0;

Page 9: NoSQL in Perspective

Relational Calculus in Action?

Relational Calculus:

Relevant Implemented Language:

{ t : {name} | ∃ s : {name, wage} ( Employee(s) ∧ s.wage = 50.000 ∧ t.name = s.name ) }

This space under construction.

Page 10: NoSQL in Perspective

Relational Model Utility

Essentially, all models are wrong, but some are useful.

- George E. P. Box

Page 11: NoSQL in Perspective

When relations are wrong

Sparse data Irregular data Poorly understood interrelationships No definable indexes Big data No vertically scalable hardware

Page 12: NoSQL in Perspective

Papers Read Around the World

Google's BigTable: http://research.google.com/archive/bigtable.html

Amazon's Dynamo: http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html

Page 13: NoSQL in Perspective

Lessons from Functional Programming

MapReduce: http://research.google.com/archive/mapreduce.html

Page 14: NoSQL in Perspective

MapReduce map(String key, String value): // key: document name

// value: document contents for each word w in value:

EmitIntermediate(w, "1");

reduce(String key, Iterator values):

// key: a word // values: a list of counts

int result = 0;

for each v in values: result += ParseInt(v);

Emit(AsString(result)); [1]

Page 15: NoSQL in Perspective

CAP Theorem

Consistency Availability Partition tolerance

Page 16: NoSQL in Perspective

CAP Theorem?

Consistency

Availability

Partition Tolerance

Page 17: NoSQL in Perspective

Sacrifice Availability

Consistency Partition Tolerance

Page 18: NoSQL in Perspective

Then, sacrifice what?

Consistency Partition Tolerance

Availability Availability

Page 19: NoSQL in Perspective

PACELC

In the event of a Partition, does the system prioritize Availability or Consistency

Else does the system prioritize Latency or Consistency?

Page 20: NoSQL in Perspective

PACELC as a Tree

Partition Else

Availability Consistency Latency Consistency

Page 21: NoSQL in Perspective

Traditional RDBMSes: PC/EC

Partition Else

Consistency Consistency

Page 22: NoSQL in Perspective

Eventually Consistent: PA/EL

Partition Else

Availability Latency

Page 23: NoSQL in Perspective

ELC: Replication Options

1. Update all nodes 2. Update the master node first 3. Update an arbitrary node first

Page 24: NoSQL in Perspective

Best of both worlds?

SQL

Page 25: NoSQL in Perspective

HadoopDB

Page 26: NoSQL in Perspective

MySQL Cluster

Page 27: NoSQL in Perspective

Riak Demo

N: persisted copies

R: read copies

W: write copies

Strong Consistency: R + W > N

Page 28: NoSQL in Perspective

Thanks

Jeff Smith [email protected]


Recommended