Advertisement

33rd degree conference

pcmanus
Apr. 17, 2012
Advertisement

More Related Content

Advertisement

33rd degree conference

  1. Main sponsor The Apache Cassandra storage engine Sylvain Lebresne
  2. About me • Sylvain Lebresne • sylvain@datastax.com • @pcmanus • Work at
  3. 1. What is Apache Cassandra 2. Data Model 3. The storage engine
  4. 1. What is Apache Cassandra 2. Data Model 3. The storage engine
  5. about:project • Distributed data store aimed at big data. • Apache project since 2010. • Version 1.0 released last October. • Proven in production (Netflix, Twitter, Reddit, Cisco, ...). Largest know cluster has over 300TB in over 400 machines.
  6. Apache Cassandra
  7. Apache Cassandra A database:
  8. Apache Cassandra A database: • distributed / decentralized
  9. Apache Cassandra A database: • distributed / decentralized • replicated & durable
  10. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic
  11. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic
  12. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic • fault-tolerant / no SPOF
  13. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic • fault-tolerant / no SPOF • highly available
  14. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic • fault-tolerant / no SPOF • highly available
  15. Apache Cassandra A database: • distributed / decentralized • replicated & durable • scalable / elastic • fault-tolerant / no SPOF • highly available • data center aware US Europe
  16. 1. What is Apache Cassandra 2. Data Model 3. The storage engine
  17. Data Model • Not SQL (no transaction, nor joins) but more than Key/Value. • Inspired by Google BigTable • Column families based.
  18. Ex: user profiles “For each user, holds profile infos” 50e8-e29b birth_year 1994 fname Justin lname Bieber Users
  19. Ex: user profiles “For each user, holds profile infos” 50e8-e29b 2ab1-f1b7 birth_year 1994 birth_year 1978 fname Justin email a@kutcher.com lname Bieber fname Ashton lname Kutcher Users
  20. Ex: user’s Tweets “For each user, tweets he has made” 50e8-e29b Timeline
  21. Ex: user’s Tweets “For each user, tweets he has made” 50e8-e29b @LiveLoveKary glad you had 0 a good birthday #muchlove Timeline
  22. Ex: user’s Tweets “For each user, tweets he has made” 50e8-e29b @NickDeMoura happy bday 1 my dude. @LiveLoveKary glad you had 0 a good birthday #muchlove Timeline
  23. Ex: user’s Tweets “For each user, tweets he has made” 50e8-e29b @MickyArison @miamiHEAT 2 thanks for the gam tonight @NickDeMoura happy bday 1 my dude. @LiveLoveKary glad you had 0 a good birthday #muchlove Timeline
  24. Ex: user’s Tweets “For each user, tweets he has made” 50e8-e29b still a little tired. back in the 3 studio today with Timbaland @MickyArison @miamiHEAT 2 thanks for the gam tonight @NickDeMoura happy bday 1 my dude. @LiveLoveKary glad you had 0 a good birthday #muchlove Timeline
  25. There’s more • Secondary indexes • Distributed counters • Composite columns
  26. 1. What is Apache Cassandra 2. Data Model 3. The storage engine
  27. Goal • Writes are harder than reads to scale • Spinning disks aren’t good with random I/O • Goal: minimize random I/O
  28. A write’s journey write( k1 , c1:v1 ) Memory Memtable Commit log Hard drive
  29. A write’s journey write( k1 , c1:v1 ) Memory k1 c1:v1 Memtable k1 c1:v1 Commit log Hard drive
  30. A write’s journey ack Memory k1 c1:v1 k1 c1:v1 Hard drive
  31. A write’s journey write( k2 , c1:v1 c2:v2 ) Memory k1 c1:v1 k2 c1:v1 c2:v2 k1 c1:v1 k2 c1:v1 c2:v2 Hard drive
  32. A write’s journey write( k1 , c1:v4 c3:v3 c2:v2 ) Memory k1 c1:v4 c2:v2 c3:v3 k2 c1:v1 c2:v2 k1 c1:v1 k2 c1:v1 c2:v2 k1 c1:v4 c3:v3 c2:v2 Hard drive
  33. A write’s journey Memory flush index cleanup k1 c1:v4 c2:v2 c3:v3 k2 c1:v1 c2:v2 SSTable Hard drive
  34. A write’s journey more updates Memory k1 c1:v5 c4:v4 k2 c1:v2 c3:v3 k2 c1:v2 c3:v3 k1 c1:v5 c4:v4 index k1 c1:v4 c2:v2 c3:v3 k2 c1:v1 c2:v2 Hard drive
  35. A write’s journey Memory flush index index k1 c1:v4 c2:v2 c3:v3 k1 c1:v5 c4:v4 k2 c1:v1 c2:v2 k2 c1:v2 c3:v3 Hard drive
  36. Writes properties • No reads or seeks • Only sequential I/O • Immutable SSTables: easy snapshots
  37. A read’s journey read( k1 ) Memory ? index index k1 c1:v4 c2:v2 c3:v3 k1 c1:v5 c4:v4 k2 c1:v1 c2:v2 k2 c1:v2 c3:v3 Hard drive
  38. A read’s journey k1 c1:v5 c2:v2 c3:v3 c4:v4 Memory merge index index k1 c1:v4 c2:v2 c3:v3 k1 c1:v5 c4:v4 k2 c1:v1 c2:v2 k2 c1:v2 c3:v3 Hard drive
  39. Compaction • Goal: keep the number of SSTables low • Merge sort against multiple sstables • Sequential I/O
  40. Compaction • Goal: keep the number of SSTables low • Merge sort against multiple sstables • Sequential I/O index k1 c1:v4 c2:v2 c3:v3 k2 c1:v1 c2:v2 index k1 c1:v5 c4:v4 k2 c1:v2 c3:v3
  41. Compaction • Goal: keep the number of SSTables low • Merge sort against multiple sstables • Sequential I/O index k1 c1:v4 c2:v2 c3:v3 k2 c1:v1 c2:v2 index k1 c1:v5 c2:v2 c3:v3 c4:v4 index k2 c1:v2 c2:v2 c3:v3 k1 c1:v5 c4:v4 k2 c1:v2 c3:v3
  42. Optimizations • Row Cache • Bloom filters: eliminates whole SSTable • Key Cache • Rows & Columns Indexes • ...
  43. Other features • Compression • Checksums • Time to live
  44. Questions?
  45. • Cassandra 1.1 scheduled in a couple of weeks • http://cassandra.apache.org/ • http://wiki.apache.org/cassandra/ • http://www.datastax.com/docs/1.0

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
Advertisement