{"id":3567,"date":"2019-11-22T08:05:32","date_gmt":"2019-11-22T08:05:32","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=3567"},"modified":"2024-04-03T09:54:01","modified_gmt":"2024-04-03T09:54:01","slug":"cassandra-architecture","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/","title":{"rendered":"Cassandra Architecture"},"content":{"rendered":"<h2><span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Architecture of Apache Cassandra&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:6273,&quot;3&quot;:{&quot;1&quot;:0,&quot;3&quot;:1},&quot;10&quot;:2,&quot;14&quot;:{&quot;1&quot;:3,&quot;3&quot;:1},&quot;15&quot;:&quot;Arial&quot;}\">Architecture of Apache Cassandra<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p>Cassandra is designed to handle big data. Cassandra\u2019s main objective is to store data over multiple nodes without single point of failure.<\/p>\n<p>Just because the hardware failure can occur at any time. Any node can be destroyed. In case of any failure data stored in another node can be used.<\/p>\n<p>Hence, Cassandra is designed with its distributed architecture.<\/p>\n<p>Cassandra stores data over different nodes with a peer to peer distributed fashion architecture.<\/p>\n<p>All the nodes exchange information with each other using a protocol known as Gossip.<\/p>\n<p>Gossip is a protocol in Cassandra by which nodes can communicate with each other.<\/p>\n<p><strong>Components of Cassandra:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3568\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png\" alt=\"\" width=\"547\" height=\"313\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png 547w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components-300x172.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/p>\n<ul>\n<li><strong>Node:<\/strong> Node is the place where data is <a href=\"https:\/\/prwatech.in\/blog\/\">stored<\/a>.<\/li>\n<li><strong>Data Center: <\/strong>A collection of nodes are known as data center. Many nodes are categorized as a data center.<\/li>\n<li><strong>Cluster: <\/strong>The cluster is a collection of many data centers.<\/li>\n<li><strong>Commit Log:<\/strong> Every write operation is written to <a href=\"https:\/\/cassandra.apache.org\/_\/index.html\">Commit<\/a> Log. Commit log is used for crash recovery.<\/li>\n<li><strong>Mem-table:<\/strong> After data written in Commit log, data is written in Mem-table. Data is written in Mem-table temporarily.<\/li>\n<li><strong>SSTable:<\/strong> When Mem-table reaches a certain threshold, data is flushed to an SSTable disk file.<\/li>\n<\/ul>\n<h4><strong>Data Replication<\/strong><\/h4>\n<p>As hardware failure may occur or links may get down at any time during data process, a solution is needed to provide a backup when a problem occurs. Hence, data is replicated for assuring no single point of failure.<\/p>\n<p>Cassandra places replicas of data on different nodes based on these two factors.<\/p>\n<ul>\n<li>Where to place next replica is determined by the Replication Strategy.<\/li>\n<li>While the total number of replicas placed over different nodes is identified by the Replication Factor.<\/li>\n<\/ul>\n<p>One Replication factor means that there is only a single copy of data while three replication factor means that there are three copies of the data on three different nodes.<\/p>\n<p>For ensuring there is no single point of failure, replication factor must be three.<\/p>\n<p>There are two kinds of replication strategies in Cassandra<\/p>\n<ul>\n<li><strong>SimpleStrategy:<\/strong><\/li>\n<\/ul>\n<p>SimpleStrategy is used when you are having just one data center. SimpleStrategy places the first replica on a node selected by the petitioner.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3569\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/simple.png\" alt=\"\" width=\"265\" height=\"200\" \/><\/p>\n<p>After that, remaining replicas are placed in clockwise direction in the Node ring.<\/p>\n<ul>\n<li>\n<h3><strong>NetworkTopologyStrategy:<\/strong><\/h3>\n<ul>\n<li>NetworkTopologyStrategy is used when you are having more than two data centers.<\/li>\n<li>In NetworkTopologyStrategy, replicas are set for every data center separately.<\/li>\n<li>NetworkTopologyStrategy places replicas in the clockwise direction in ring until reaches the 1st node in another rack.<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3570\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/multi.png\" alt=\"\" width=\"622\" height=\"398\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/multi.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/multi-300x192.png 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/>\n<ul>\n<li>This strategy tries to place replicas over different racks in the same data center.<\/li>\n<li>This is due to the reason that sometimes failure or problem can occur in the rack.<\/li>\n<li>Then replicas on other nodes can provide data.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Architecture of Apache Cassandra &nbsp; Cassandra is designed to handle big data. Cassandra\u2019s main objective is to store data over multiple nodes without single point of failure. Just because the hardware failure can occur at any time. Any node can be destroyed. In case of any failure data stored in another node can be used. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[92,1703],"tags":[],"class_list":["post-3567","post","type-post","status-publish","format-standard","hentry","category-cassandra","category-cassandra-modules"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Architecture of Apache Cassandra - Prwatech<\/title>\n<meta name=\"description\" content=\"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Architecture of Apache Cassandra - Prwatech\" \/>\n<meta property=\"og:description\" content=\"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-22T08:05:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-03T09:54:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/\",\"url\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/\",\"name\":\"Architecture of Apache Cassandra - Prwatech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png\",\"datePublished\":\"2019-11-22T08:05:32+00:00\",\"dateModified\":\"2024-04-03T09:54:01+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png\",\"width\":547,\"height\":313},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cassandra Architecture\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Architecture of Apache Cassandra - Prwatech","description":"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Architecture of Apache Cassandra - Prwatech","og_description":"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.","og_url":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2019-11-22T08:05:32+00:00","article_modified_time":"2024-04-03T09:54:01+00:00","og_image":[{"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png","type":"","width":"","height":""}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/","url":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/","name":"Architecture of Apache Cassandra - Prwatech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png","datePublished":"2019-11-22T08:05:32+00:00","dateModified":"2024-04-03T09:54:01+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Master Architecture of Apache Cassandra - Dive deep with our expert instructors and comprehensive curriculum.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/components.png","width":547,"height":313},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/cassandra\/cassandra-modules\/cassandra-architecture\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Cassandra Architecture"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=3567"}],"version-history":[{"count":4,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3567\/revisions"}],"predecessor-version":[{"id":11253,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3567\/revisions\/11253"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=3567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=3567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=3567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}