NoSQL in Perspective
-
Upload
jeff-smith -
Category
Technology
-
view
676 -
download
5
Transcript of NoSQL in Perspective
![Page 2: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/2.jpg)
NoSQL on Wikipedia
92 databases 8 types 6 sub-types
![Page 3: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/3.jpg)
Easy Questions
Is this a graph? Do I already have XML or JSON? Is this a caching problem?
![Page 4: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/4.jpg)
Paul Graham on Programming Languages
Lisp
C
![Page 5: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/5.jpg)
Math Problem
Lisp is just math. Math doesn't get stale. What in databases is just math?
![Page 6: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/6.jpg)
Putting the R in RDBMSes
Relation
Attributes
Tuples
![Page 7: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/7.jpg)
Database Analogy
C is to Lisp as Relational Algebra is to Relational Calculus
C: Lisp::Relational Algebra: Relational Calculus
![Page 8: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/8.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/9.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/10.jpg)
Relational Model Utility
Essentially, all models are wrong, but some are useful.
- George E. P. Box
![Page 11: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/11.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/12.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/13.jpg)
Lessons from Functional Programming
MapReduce: http://research.google.com/archive/mapreduce.html
![Page 14: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/14.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/15.jpg)
CAP Theorem
Consistency Availability Partition tolerance
![Page 16: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/16.jpg)
CAP Theorem?
Consistency
Availability
Partition Tolerance
![Page 17: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/17.jpg)
Sacrifice Availability
Consistency Partition Tolerance
![Page 18: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/18.jpg)
Then, sacrifice what?
Consistency Partition Tolerance
Availability Availability
![Page 19: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/19.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/20.jpg)
PACELC as a Tree
Partition Else
Availability Consistency Latency Consistency
![Page 21: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/21.jpg)
Traditional RDBMSes: PC/EC
Partition Else
Consistency Consistency
![Page 22: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/22.jpg)
Eventually Consistent: PA/EL
Partition Else
Availability Latency
![Page 23: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/23.jpg)
ELC: Replication Options
1. Update all nodes 2. Update the master node first 3. Update an arbitrary node first
![Page 24: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/24.jpg)
Best of both worlds?
SQL
![Page 25: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/25.jpg)
HadoopDB
![Page 26: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/26.jpg)
MySQL Cluster
![Page 27: NoSQL in Perspective](https://reader033.fdocuments.in/reader033/viewer/2022052523/5558c39ed8b42a235c8b4614/html5/thumbnails/27.jpg)
Riak Demo
N: persisted copies
R: read copies
W: write copies
Strong Consistency: R + W > N