Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 April NoSQL: Cassandra Architecture – Read and Write operations in The Ring (Day 2)

NoSQL: Cassandra Architecture – Read and Write operations in The Ring (Day 2)

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In the previous day, I shared some of the essential key concepts of the Cassandra Architecture.
In this post, I am sharing the basic architecture of reading and writing operations of Cassandra.

Cassandra Ring:

Cassandra is using a consistent hashing algorithm to treat all nodes of the cluster equally.

NoSQL Cassandra Ring

A Cassandra cluster is visualised as a Ring in which different nodes are participating with the same name. It can exchange state information with a maximum of three other nodes.
A token range assigns to each node which determines its position in the cluster.

Cassandra is using Gossip Protocol so whenever any node starts, it obtains information about the other nodes by exchanging information with each other.

A Partitioner is responsible for preparing the set of data for each node.
Cassandra has three different types of Partitioners, Murmur3Partitioner (default), RandomPartitioner and a ByteOrderedPartitioner.

Each node is performing replications of data basis on defined replication strategy. Basically there two types of replication strategy, one is Simple Strategy and second is Network Topology Strategy.

A Simple Strategy works in the clockwise, and Network Topology works for multiple data centres.

How it executes Write Operations?

A Cassandra is Masterless distributed architecture, and there is no any Master and Slave mechanism like any other distributed system.

NoSQL Cassandra Architecture

At any given point in time, the client can connect to any node and that connected node called as a coordinator.
Based on the partition key and replication strategy, Coordinator forwards and replicates data to all applicable nodes.

Each node processes the request individually.
Every node first writes data into the commit log and then writes into the memtable.

The commit log ensures the durability because memtable is dealing with memory so whenever data is lost then we can use commit log to restore the data.
Whenever memtable is flushed or full, it is written to the SSTable (Sorted String Table) of the disk.

Every SSTable creates three files on the disk which include a bloom filter, a key index and a data file. Over a period, a number of SSTables are created.

How It executes Read Operations?

As Cassandra is Masterless architecture so clients can connect to any node of the cluster ring.
Like write operation, chosen node is called as coordinator and is responsible for returning the requested data.

A row key must be supplied for every read operation. The coordinator uses the row key to determine the first replica.

If replica has a different version of the data, coordinator returns the latest version to the client by issuing read repair command with the older version of the data.

Each read request fetches the data from memtable and SSTables after that it merged this data and returned to the coordinator.
Internally SSTables are using a Bloom Filter to check requested row key whether it exists in SSTable or not.

Apr 28, 2016Anvesh Patel
NoSQL: Key concepts of the Cassandra Architecture (Day 1)NoSQL: Install Single Node Cassandra 3.5 on Ubuntu 14.04
Anvesh Patel
Anvesh Patel

Database Engineer

April 28, 2016 Cassandra, NoSQLAnvesh Patel, Architecture, Cassandra, Cluster Ring, Column Store, database, database research and development, dbrnd, Document Store, Graph Store, Key Value Store, Memtable, NoSQL, Not Only SQL, SSTable, Unstrucutred
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....