NoSQL: what's under the hood?

1,744 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,744
On SlideShare
0
From Embeds
0
Number of Embeds
458
Actions
Shares
0
Downloads
1
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • UPAdding resources to a single node in a systemOUTAdd more nodes to a system
  • master-master (no master)master-slaveStore the same data on multiple serversCan speedup queriesCan speedup writesDurability and availability
  • Partitioning dataCan speed up read and writes
  • NoSQL: what's under the hood?

    1. 1. what’s under the hood?<br />Aleksey Solntsev<br />
    2. 2. The Digital Universe<br />
    3. 3. Some facts<br />
    4. 4. What’s they have in common?<br />Performance<br />Scalability<br />Price<br />
    5. 5. RDBMS<br />ACID doesn’t scale well horizontally<br />Shardingbreaks relations<br /> Joins are inefficient<br />Transactions overhead<br />Schema is not flexible<br />
    6. 6. ACID<br /><ul><li>Atomicity
    7. 7. Consistency
    8. 8. Isolation
    9. 9. Durability</li></li></ul><li>NoSQL: Not Only SQL<br />Non-Relational<br />Distributed<br />Scaling Out Scalability<br />Schema-less/Schema-free <br />Eventual Consistency<br />
    10. 10. We need to scale!<br />
    11. 11. Replication aka RAID1<br />
    12. 12. Sharding aka RAID0<br />
    13. 13. CAP theorem (Brewer's theorem)<br />
    14. 14. ACID<br /><ul><li>Atomicity
    15. 15. Consistency
    16. 16. Isolation
    17. 17. Durability</li></ul>BASE<br /><ul><li>Basically Available
    18. 18. Soft State
    19. 19. Eventually Consistent</li></li></ul><li>NoSQL Taxonomy<br />Key Value / Tuple Store<br />Eventually Consistent Key Value Store<br />Wide Column Store / Column Families<br />Document Oriented<br />XML Databases<br />Object Databases <br />Graph Databases<br />
    20. 20. NoSQL Taxonomy<br />Key Value / Tuple Store<br />Eventually Consistent Key Value Store<br />Wide Column Store / Column Families<br />Document Oriented<br />XML Databases<br />Object Databases <br />Graph Databases<br />
    21. 21. <ul><li>Focus on scaling to huge amounts of data
    22. 22. Designed to handle massive load</li></li></ul><li>Distributed hash table<br />
    23. 23. Partitioning 1/2<br />
    24. 24. Partitioning 2/2<br />
    25. 25. Primitive API<br />CRUD<br />
    26. 26. Map/Reduce for aggregation<br />map(String filename, String document) {<br /> List<String> T = tokenize(document);<br /> for each token in T {<br /> emit ((String)token, (Integer) 1);<br /> }<br />}<br />reduce(String token, List<Integer> values) {<br /> Integer sum = 0;<br /> for each value in values {<br /> sum = sum + value;<br /> }<br /> emit ((String)token, (Integer) sum);<br />}<br />
    27. 27. MapReduceи Hadoop?<br />
    28. 28. <ul><li>Single infinitely large table
    29. 29. Each rows can have different number of columns</li></li></ul><li>Column<br />
    30. 30. SuperColumn<br />
    31. 31. ColumnFamily<br />
    32. 32. Keyspace<br />
    33. 33.
    34. 34. API<br />No standards:<br />Structure manipulation<br />Cluster administration<br />Query language<br />
    35. 35. <ul><li>Semi-structured complex documents
    36. 36. Document versioning
    37. 37. Support references between documents</li></li></ul><li>{<br /> "_id" : ObjectId("497ce96f395f2f052a494fd4"),<br /> "title" : "Awesome Blog Post",<br /> "body" : "Text text text text, text text text ...",<br /> "created": "Tue, 3 Jan 2011 11:13:56 GMT",<br /> "publishDate" : "Tue, 21 Jan 2011 20:42:47 GMT",<br /> "tags" : [ "css", "javascipt", "jquery" ],<br /> "comments" : [<br /> {<br /> "name" : "Kelly Glover"<br /> "created" : "Tue, 22 Jan 2011 2:22:32 GMT",<br /> "text" : "This is a very good ..."<br /> },<br /> {<br /> "name" : "Pat Tally"<br /> "created" : "Tue, 22 Jan 2011 4:54:41 GMT",<br /> "text" : "Thanks!",<br /> "admin" : true<br /> } ],<br /> "shortUrl" : "awesome-blog-post"<br />}<br />
    38. 38. Advances Query API<br />Find by example<br />db.stat.find({clicks: {$gt: 10} });<br />Find & sort<br />db.users.find({}).sort({name: 1});<br />Skip & limit<br />db.users.find().skip(20).limit(10);<br />
    39. 39. @a_solntsev<br />

    ×