Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Apache Cassandra - Concepts et fonctionnalités

2,779 views

Published on

Apache Cassandra - Concepts et fonctionnalités, 25/02/2014

Présentation de Cassandra pour le premier évènement "Lyon Cassandra Users" (organisé par DataStax & Zenika).

* Présentation de Cassandra
* Concepts clés (Théorie & Architecture)
* Installation
* Les outils DataStax : DevCenter et OpsCenter
* Modèle de données
* Requêtes

Published in: Technology
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Apache Cassandra - Concepts et fonctionnalités

  1. 1. Apache Cassandra Concepts et fonctionnalités Romain Hardouin Lyon Cassandra Users
  2. 2. Plan Présentation de Cassandra Concepts clés Installation Les outils DataStax : DevCenter et OpsCenter Modèle de données Requêtes
  3. 3. Présentation de Cassandra “Semblable à l'Aphrodite d'or” – Homère
  4. 4. NoSQL* * ≠ Big Data Lyon Cassandra Users
  5. 5. Big Data* * 3V = Volume, Vélocité, Variété Lyon Cassandra Users
  6. 6. Cassandra ● SGBD NoSQL orienté colonnes ● Distribué : P2P ● Haute disponibilité : no SPOF ● Massivement parallèle ● Scalabilité linéaire ● Multi data centers ● Réplication native ● Open source : Facebook → Apache
  7. 7. What were the top reasons for going with Cassandra? ● No single points of failure ● Highly scalable writes (we have highly variable write traffic) ● A healthy and productive open source community – Ryan King Lyon Cassandra Users
  8. 8. Qui l'utilise ?
  9. 9. Qui l'utilise ?
  10. 10. Concepts clés Architecture
  11. 11. Cluster ● Noeud = Instance de Cassandra ● Cluster = Ring = Ensemble des noeuds
  12. 12. Théoreme CAP ● Seuls deux des trois sont réalisables Haute disponibilité A C Cohérence @eric_brewer P Tolérance aux partitionnements
  13. 13. Théoreme CAP ● En pratique – Continuum – Consistency Level (CL) – A Latence ! C P
  14. 14. Cohérence in fine ● ● ● Eventually consistency A un instant T, la donnée la plus récente n'est pas présente partout Pas de suppression instantanée – Tombstone
  15. 15. Cohérence paramétrable ● Combien de répliques écrites/lues avant aquittement ● ● ● – ONE, QUORUM, ALL ANY SERIAL Datacenter aware : ● ● LOCAL_ONE, LOCAL_QUORUM EACH_QUORUM
  16. 16. Gossip ● Protocole epidémique de communication P2P ● Echange d'informations chaque seconde ● Réseau overlay maillé complet
  17. 17. Partitioner ● Token = f – – ● Murmur3, MD5 BOP Token => noeud (row) Lyon Venise pays gentilé FR Lyonnais pays gentilé IT Vénitiens
  18. 18. Facteur de réplication ● Nombre d'occurrences d'une donnée – Replication Factor (RF) RF = 2
  19. 19. Réplication ● Replica placement strategy – NetworkTopologyStrategy Lyon RF = 2 pays gentilé FR Lyonnais
  20. 20. Snitch ● Comment connaitre la topologie du réseau ? – PropertyFile, GossipingPropertyFile – EC2(MultiRegion) – RackInferring 10 . 1 . 2 . 3 DC Noeud Rack
  21. 21. Coordinator ● P2P => on contacte n'importe quel noeud ● Noeud contacté = coordinateur ● Le coordinateur contacte les répliques (proxy) Client
  22. 22. Ecriture ● Exemple avec RF = 2, CL = ONE Client
  23. 23. Repair ● Hinted-handoff – ● Read repair – ● Fenêtre paramétrable Probabilité paramétrable Anti-entropy repair – Indispensable – Généralement hebdomadaire
  24. 24. Installation
  25. 25. Installation ● Linux – Production ● Windows ● Mac OS ● Ne pas mixer les OS
  26. 26. Java ● Oracle JDK – – ● Cassandra 1 : v6 Cassandra 2 : v7 Production – Java Native Access (JNA)
  27. 27. Debian ● Apache – deb http://www.apache.org/dist/cassandra/debian V main ● ● V = 12x, 20x DataStax – deb http://debian.datastax.com/community stable main ● ● ● Cassandra, DevCenter, OpsCenter, DSC apt-get install cassandra → v2.0 apt-get install cassandra=1.2.15
  28. 28. RedHat / CentOS ● DataStax – http://rpm.datastax.com/community ● Cassandra, DevCenter, OpsCenter, DSC
  29. 29. Les outils DataStax DevCenter et OpsCenter
  30. 30. DevCenter
  31. 31. OpsCenter
  32. 32. OpsCenter
  33. 33. Modèle de données SGBD orienté colonnes
  34. 34. Column ● Identifiée par son nom ● Valeur et nom typés – blob, int, text, timestamp, timeuuid, uuid, ... ≤ 9 MO conseillé Max 2 GO Nom Valeur Timestamp Résout les conflits => NTP, VMWare tools
  35. 35. Column ● Time to live – Ne remplace pas une purge métier Nom Valeur Timestamp TTL
  36. 36. Column ● Compteur distribué – Type spécial Nom Valeur Timestamp
  37. 37. Column ● Nom porteur d'informations – Colonne composite – Intérêt : requêtage “ rhone:* ” rhone:bron rhone:lyon rhone:villeurbanne Valeur Timestamp Valeur Timestamp Valeur Timestamp
  38. 38. Row ● Identifiée par sa clé (typée) ● Contient des colonnes, triées par nom ● Une ligne est stockée sur un seul noeud * 2.109 Nom colonne 1 ... N Clé Valeur colonne 1 Timestamp * hors réplication
  39. 39. Column Family (CF) ● Regroupe les lignes et donc les colonnes ● Les lignes ne sont pas triées * ● Arena allocation : ≤ 1000 CF Nom CF Colonne 1 Clé 1 ... N Valeur 1 Timestamp ... ... Colonne 1 Clé N ... N Valeur 1 Timestamp * sauf si le ByteOrderedPartitioner est utilisé
  40. 40. Keyspace ● Regroupe les column families ● Peut coûteux en mémoire Nom keyspace 1 Nom CF N Nom CF 1 Colonne 1 ... N Colonne 1 ... N Clé 1 Clé 1 Valeur 1 Timestamp Timestamp Colonne 1 ... N ... Valeur 1 Timestamp Valeur 1 ... Colonne 1 ... N ... Valeur 1 Timestamp
  41. 41. Keyspace ● Exemple – Timestamp non représentés meetup.com members events 30a9e2d2 ... 31369e8e event_name event_date Cassandra 2014-02-25 ... ... event_name event_date Hadoop 2014-03-13 bob firstname ... Robert ... ... bill firstname William ...
  42. 42. Requêtes SELECT * FROM big_data
  43. 43. NoSQL ● Les applications doivent en faire plus – – ● Moins de fonctionnalités que les SGBDR Dénormalisation Pas de transactions – V1.0 : Row level isolation – v2.0 : Lightweight transactions, CAS ● Pas de jointures ● Pas de «GROUP BY»
  44. 44. Par où commencer ● Penser “requête” – – ● Critères de recherches Tris Penser “alimentation” – Comment les données arrivent ? – Données brutes ?
  45. 45. Penser "requêtes" ● Comment faire sans jointures ? – – ● Peu de données : 2 requêtes + filtre mémoire Big data : autant de Column Family que de requêtes Exemple : – Rechercher les meetup d'une ville – SELECT * FROM events WHERE city = 'Lyon' – Column Family "events by city"
  46. 46. "events by city" TimeUUID events_by_city lyon 31369e8e ... 30a9e2d2 <valueless> ... <valueless> Valueless pattern events 30a9e2d2 ... 31369e8e event_name event_date Cassandra 2014-02-25 ... ... event_name event_date Hadoop 2014-03-13
  47. 47. Penser "requêtes" ● Comment faire sans aggregation ? – Peu de données : travail en mémoire – Big data : Hadoop, Hive, Pig, etc.
  48. 48. Penser "alimentation" Exemple : séries temporelles => wide rows – Données financières ● – Actions, produits dérivés, etc. Données brutes ● Capteurs, satellites, etc. sensors Sensor_1:<date> e598170e <blob> e53a9da4 ... e408c24e <blob> ... <blob> 100 mesures / s => 8 640 000 colonnes
  49. 49. CQL ● Simplifie l'utilisation – ● cqlsh, DevCenter CQL 3 – Cassandra >= 1.2 CQL Implémentation
  50. 50. CQL CREATE TABLE members ( username text, firstname text, email list<text>, PRIMARY KEY (username) ); members bob firstname ... Robert ... ... bill ... firstname ... William INSERT INTO members (username, firstname, email) VALUES ('bob', 'Robert', ['bob@gmail.com', 'bob@yahoo.fr'] );
  51. 51. Référence DataStax : datastax.com www.datastax.com/docs Interview Ryan King (Twitter) : http://nosql.mypopescu.com/post/407159447/cassandra-twitter-an-interview-with-ryan-king

×