<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gaurav Gupta</title>
    <description>The latest articles on DEV Community by Gaurav Gupta (@gauravguptadeveloper).</description>
    <link>https://dev.to/gauravguptadeveloper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F701104%2Fec54edcd-f47f-4218-b168-881d84e443da.jpeg</url>
      <title>DEV Community: Gaurav Gupta</title>
      <link>https://dev.to/gauravguptadeveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gauravguptadeveloper"/>
    <language>en</language>
    <item>
      <title>Apache Cassandra - Awesome Part 2 - Data Modelling</title>
      <dc:creator>Gaurav Gupta</dc:creator>
      <pubDate>Sat, 23 Apr 2022 18:48:09 +0000</pubDate>
      <link>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-2-data-modelling-138b</link>
      <guid>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-2-data-modelling-138b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Data Modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basically Before understanding the wide columnar stores, we have to first look at the way that how cassandra stores the data.&lt;br&gt;
So if you are coming from RDBMS background. Then please hold your horses and i request you to forget everything about it. &lt;/p&gt;

&lt;p&gt;Let's get to bottom up approach of understanding the Data modelling in Cassandra.&lt;/p&gt;

&lt;p&gt;So if you have to store the information say information of user, then in that case you will have an array of String in which you have to store the data.&lt;/p&gt;

&lt;p&gt;eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String[] information = new String[3];

["Gaurav","25","Post Graduation"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but as you can see that storing information in such a way is waste. Since first you have to maintain a record of what information[0] represents and so on.&lt;/p&gt;

&lt;p&gt;and next time you have to insert the data in the same approach.&lt;/p&gt;

&lt;p&gt;Here comes your saviour called MAPS. &lt;br&gt;
So we will assign each values with names, and then we will fetch the values by name so now ordering is not so important. Let's see how?&lt;/p&gt;

&lt;p&gt;Going with same above example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Map&amp;lt;String, String&amp;gt; information = new HashMap&amp;lt;&amp;gt;();
information.put("name","gaurav");
information.put("age","25");
information.put("education","Post graduation");

NAME           AGE      Education
 |              |           |
gaurav          25         PG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now what do you think?&lt;/p&gt;

&lt;p&gt;Is it looking ok?&lt;br&gt;
Let's say i now need to store other information of user, then?&lt;/p&gt;

&lt;p&gt;It means there is no way of unify some collection of name/value pairs.&lt;br&gt;
and no way to repeat the same column name.&lt;/p&gt;

&lt;p&gt;Because if you again do &lt;/p&gt;

&lt;p&gt;&lt;code&gt;information.put("names","joshua");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then the previous name will be lost.&lt;/p&gt;

&lt;p&gt;So we need something that will group some of the column&lt;br&gt;
values together in a distinctly addressable group.&lt;br&gt;
We need a key to refer this group of columns.&lt;br&gt;
We need rows.&lt;/p&gt;

&lt;p&gt;Then if we get single row then we can get the entire column family.&lt;/p&gt;

&lt;p&gt;So now what we need is something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Map&amp;lt;Row(Primary Key), ColumnarClass&amp;gt; cassandraDataModelling = new HashMap&amp;lt;&amp;gt;();

class ColumnarClass&amp;lt;T&amp;gt;{
   Dynamic column names;
   TimeStamp; (necessary field)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and now the image of above data structure is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.tutorialspoint.com/cassandra/images/cassandra_column_family.jpg"&gt;Image Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cassandra defines a column family to be a logical division that associates similar data.&lt;br&gt;
For example, we might have a User column family, a Hotel column family, an&lt;br&gt;
AddressBook column family, and so on. In this way, a column family is somewhat&lt;br&gt;
analogous to a table in the relational world.&lt;/p&gt;

&lt;p&gt;To make it more easy and visually appealing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User: ColumnFamily 1
 Josh: RowKey
     email: josh@ssd.com, ColumnName:Value
     age: 22 ColumnName:Value
 Gaurav: RowKey
     email: gaurav@mailcom ColumnName:Value
Vehicle: ColumnFamily 2
 Bike: RowKey
     Period: 1968-2010 ColumnName:Value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly you can have a super columnar family, which is nothing but a maps of map i.e&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Map&amp;lt;RowKey, Map&amp;lt;RowKey, ColumnarClass&amp;gt;&amp;gt; = new HashMap&amp;lt;&amp;gt;();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.stack.imgur.com/Q4S2z.png"&gt;Image Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where a row in a column family holds a collection of name/value pairs, the super&lt;br&gt;
column family holds subcolumns, where subcolumns are named groups of columns.&lt;br&gt;
So the address of a value in a regular column family is a row key pointing to a column&lt;br&gt;
name pointing to a value, while the address of a value in a column family of type&lt;br&gt;
“super” is a row key pointing to a column name pointing to a subcolumn name&lt;br&gt;
pointing to a value. Put slightly differently, a row in a super column family still contains&lt;br&gt;
columns, each of which then contains subcolumns.&lt;/strong&gt;&lt;br&gt;
(This text Source came from Cassandra The definitive guide.)&lt;/p&gt;

&lt;p&gt;So that’s the bottom-up approach to looking at Cassandra’s data model. &lt;/p&gt;

&lt;p&gt;There is many more to this. But again you have to hold your horses and stay tuned for next Awesome Cassandra article.&lt;/p&gt;

&lt;p&gt;If you have any suggestions or something that you feel is wrong. Feel free to drop your comments.&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>cassandra</category>
      <category>java</category>
      <category>system</category>
    </item>
    <item>
      <title>Apache Cassandra - Awesome Part 1 - What is Apache Cassandra</title>
      <dc:creator>Gaurav Gupta</dc:creator>
      <pubDate>Sat, 23 Apr 2022 02:26:01 +0000</pubDate>
      <link>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-1-5e1d</link>
      <guid>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-1-5e1d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apache Cassandra is an open source, distributed, NoSQL database. It presents a partitioned wide column storage model with eventually consistent semantics.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open source&lt;/strong&gt; - cassandra is open licensed. Anyone can contribute in this project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed&lt;/strong&gt; - These are the database that are stored on multiple locations either with Homogeneous or Heterogenous properties. &lt;br&gt;
Link: &lt;a href="https://www.geeksforgeeks.org/distributed-database-system/"&gt;GFG&lt;/a&gt; &lt;a href="https://fauna.com/blog/the-why-and-how-of-distributed-databases"&gt;fauna&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NoSQl Database&lt;/strong&gt; - NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently than relational tables. NoSQL databases come in a variety of types based on their data model. The main types are document, key-value, wide-column, and graph.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For partitioned wide column storage model, let's discuss this on next series.&lt;/p&gt;

</description>
      <category>cassandra</category>
      <category>java</category>
      <category>systems</category>
    </item>
    <item>
      <title>Apache Cassandra - Awesome Part 0 - Beginning</title>
      <dc:creator>Gaurav Gupta</dc:creator>
      <pubDate>Sat, 23 Apr 2022 02:01:53 +0000</pubDate>
      <link>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-0-2m5e</link>
      <guid>https://dev.to/gauravguptadeveloper/apache-cassandra-awesome-part-0-2m5e</guid>
      <description>&lt;p&gt;Hi, In this series of articles we will explore that why apache cassandra is so awesome as NoSQL database. &lt;br&gt;
I will be going to write each and every detail of Documentation, and If in any case if there are keywords on which i got stuck then we will start on that topic first and will follow the Depth first search mechanism.&lt;/p&gt;

&lt;p&gt;Let's start with this series of article and hope to see you soon on the next one i.e Apache Cassandra - Awesome Part 1.&lt;/p&gt;

</description>
      <category>cassand</category>
      <category>java</category>
      <category>systems</category>
    </item>
  </channel>
</rss>
