Introduction to NoSQL & Apache Cassandra

1,692 views
1,347 views

Published on

An introduction to NoSQL databases and an overview of Apache Cassandra as a column family database.

Presentation I gave at Synechron Technologies

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

No Downloads
Views
Total views
1,692
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
1
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Introduction to NoSQL & Apache Cassandra

  1. 1. Introduction to NoSQL & Cassandra chetan.baheti@synechron.com
  2. 2. 2
  3. 3. RDBMS 3
  4. 4. Top Ranked (Source http://db-engines.com/en/ranking) 4
  5. 5. What is a relation database? Thou shalt not break my rules 5
  6. 6. Problems? 6
  7. 7. 7
  8. 8. SCALE-UP vs SCALE-OUT 8
  9. 9. Sharding 9
  10. 10. The Relational Model OrderId LineItemId LineItems OrderId UserId OrderDate ShippingAddressId Orders UserId Name Users AddressId Street City Addresses 10
  11. 11. Unstructured data 11
  12. 12. RDBMS NoSQL 12
  13. 13. What is NoSQL? (Source: http://nosql-database.org/ ) 13
  14. 14. Key Value Column Family Graph Document Store 14
  15. 15. Key Value Pair Databases Usage: Briskly changing data and high availability. Example: Stock Quotes 15
  16. 16. Document Store Databases Order-13235 Usage: Occasionally updated data. Example: Blogs, Content Mgmt Systems 16
  17. 17. Column family Usage: Read/write intensive applications. Example: Social networking, Logs data 17
  18. 18. From Cassandra Tutorial http://www.datastax.com/docs/0.8/ddl/index 18
  19. 19. 19
  20. 20. Graph Databases (Source http://markorodriguez.com/) Stephen is a member of a graph-oriented engineering group called TinkerPop. Stephen contributes to Rexster Rexster is related to other projects via software dependencies. When a user finds a bug in Rexster, they issue a ticket Usage: Spatial data storage, networks. Example: friends and family associations on facebook 20
  21. 21. CAP Theorem (Source: http://blog.beany.co.kr/archives/275) 21
  22. 22. Atomicity Consistency Isolation Durability BAsically Available Soft state Eventually Consistent 22
  23. 23. Apache Cassandra 23
  24. 24. Who’s using Cassandra (Source: http://www.slideshare.net/jbellis/cassandra-at-nosql-matters-2012) 24
  25. 25. Apache Cassandra 25
  26. 26. No-SPOF, Multi-master (Source: http://www.slideshare.net/jbellis/cassandra-at-nosql-matters-2012) No-SPOF Single Point of Failure 26
  27. 27. Linear Scalability (Source: http://www.datastax.com/documentation/cassandra/2.0/webhelp/index.html ) 27
  28. 28. Partitioning Chetan 24,235 John 18,789 Avani 34,923 # Monty Node D Node A 8978 Start End 1 10,000 Node B 19,999 20,000 Node C 9999 29,999 30,000 39,999 28
  29. 29. Terminology Source: http://www.codeproject.com/Articles/279947/Migration-of-Relational-Data-structure-to-Cassandr 29
  30. 30. Terminology RELATIONAL DATA MODEL SERVER DATABASE/SCHEMA TABLE PRIMARY KEY COLUMN VALUE CASSANDRA DATA MODEL (STANDARD) CASSANDRA DATA MODEL (SUPER) CLUSTER KEY SPACE COLUMN FAMILY KEY COLUMN NAME SUPER COLUMN NAME COLUMN VALUE COLUMN NAME COLUMN VALUE 30
  31. 31. So how do we talk to Cassandra? Thrift 31
  32. 32. Cassandra Query Language (CQL) Cassandra 1.x CREATE COLUMNFAMILY users Cassandra 3.x CREATE TABLE users SQL CQL 32
  33. 33. Cassandra Query Language (CQL) 33
  34. 34. Cassandra Query Language (CQL) 34
  35. 35. Kahaani Khatam Hone Ko Aayi, Aur Saala Action Shuru Hi Nahin Huwa 35
  36. 36. Critique 36
  37. 37. Too much Specialization? (Source: http://parelastic.com/blog/nosql-vs-sql-hoopla-another-turn-screw) 37
  38. 38. 38
  39. 39. Know your use case 39
  40. 40. RDBMS NoSQL 40
  41. 41. Polyglot persistence (Source: http://www.martinfowler.com/bliki/PolyglotPersistence.html) 41
  42. 42. Feedback https://www.surveymonkey.com/s/PSCC8WJ 42
  43. 43. References http://architecture-soa-bpm-eai.blogspot.in/2011/08/limitations-of-relational-database.html http://architects.dzone.com/articles/rdbms-vs-nosql http://en.wikipedia.org/wiki/Codd's_12_rules http://www.youtube.com/watch?v=qI_g07C_Q5I (Talk by Martin Fowler on NoSQL) http://ayende.com/blog/4500/that-no-sql-thing-column-family-databases http://ayende.com/blog/tags/nosql http://www.julianbrowne.com/article/viewer/brewers-cap-theorem (Cap Theorem) http://www.datastax.com/documentation/cassandra/2.0/webhelp/index.html http://techblog.netflix.com/2011/11/benchmarking-cassandra-scalability-on.html http://www.codeproject.com/Articles/279947/Migration-of-Relational-Data-structure-to-Cassandr 43

×