Alternative databases continue to establish their role in the technology stack of the future—and for many, the technology stack of the present. Making mature engineering decisions about when to adopt new products is not easy, and requires that we learn about them both from an abstract perspective and from a very concrete one as well. If you are going to recommend a NoSQL database for a new project, you're going to have to look at code. In this talk, we'll examine three important contenders in the NoSQL space: Cassandra, MongoDB, and Neo4J. We'll review their data models, scaling paradigms, and query idioms. Most importantly, we'll work through the exercise of modeling a real-world problem with each database, and look at the code and queries we'd use to implement real product features. Come to this session for a thorough and thoroughly practical smackdown between three important NoSQL products.
15. name: role: status:
tim
Tim teacher Cool
Wednesday, October 17, 12 15
16. name: role: status:
tim
Tim teacher Cool
name: role:
kristen marketing
Kristen
Wednesday, October 17, 12 16
17. name: role: status:
tim
Tim teacher Cool
name: role:
kristen marketing
Kristen
billy role:
CEO
Wednesday, October 17, 12 17
18. name: role: status:
tim
Tim teacher Cool
name: role:
kristen marketing
Kristen
billy role:
CEO
name: role: status:
matt
Matt founder ubercool
Wednesday, October 17, 12 18
19. Outer hash key Inner hash key
name: role: status:
tim
Tim teacher Cool
name: role:
kristen marketing
Kristen
billy role:
CEO
name: role: status:
matt
Matt founder ubercool
Wednesday, October 17, 12 19
20. Scale Idiom
Amazon Dynamo
Horizontal scalability
No distinguished nodes
Fault tolerance
Wednesday, October 17, 12 20
21. Queries
Nested hash table lookup
Single primary key
Ranged lookups
Wednesday, October 17, 12 21
23. Queries
CREATE COLUMNFAMILY Contacts (KEY uuid PRIMARY KEY);
CREATE COLUMNFAMILY Monkey (KEY text PRIMARY KEY,
id_tag long,
emotion text)
WITH comment='Simian Emotional States'
AND read_repair_chance = 0.5;
Wednesday, October 17, 12 23
24. Queries
UPDATE Contacts SET name='Tim Berglund'
WHERE KEY = B70DE1D0-9908-4AE3-BE34-5573E5B09F14;
UPDATE Monkeys
USING CONSISTENCY EACH_QUORUM
SET emotion = 'Angry',
name = 'Baby Boss'
WHERE KEY = 'OREILLY:8827';
Wednesday, October 17, 12 24
25. Queries
SELECT * FROM Contacts
WHERE KEY = B70DE1D0-9908-4AE3-BE34-5573E5B09F14;
SELECT FIRST 1000 FROM Temperatures
WHERE KEY = 7627748986;
SELECT emotion, id_tag FROM Monkeys
USING CONSISTENCY ONE
WHERE KEY = 'OREILLY:8827';
Wednesday, October 17, 12 25
26. License
Apache Public License 2.0
DataStax
http://datastax.com/dev
Wednesday, October 17, 12 26
27. Overview
The leader at scale
Data model learning curve
Great backing from DataStax
Innovation (Brisk, Solandra)
Wednesday, October 17, 12 27
41. Overview
NoSQL mindshare leader
Easy to adopt
Usually used at smaller scale
Not your father’s database!
(More like your young uncle)
Wednesday, October 17, 12 41
43. Data Model
Graph Database
Nodes and Relationships
Arbitrary key/value bundles
Wednesday, October 17, 12 43
44. Data Model
...
How do I use that?
Easily!
Wednesday, October 17, 12 44
45. Data Model
Graph Database Traversal
manages manages navigates identifies expresses
Indexes Graph Algorithm
map to records data in Paths
map to Relationships records data in order
map from organize
have Nodes
have
Properties
Wednesday, October 17, 12 45
46. Data Model
Graph Database Traversal
manages manages navigates identifies e
Indexes Graph A
map to records data in Paths
Wednesday, October 17, 12 46
47. Indexes Graph Algorithm
Data Model
map to records data in Paths
map to Relationships records data in order
map from organize
have Nodes
Wednesday, October 17, 12 have 47
48. map to Data Model
Relationships records data in order
map from organize
have Nodes
have
Properties
Wednesday, October 17, 12 48