<?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>Forem: DevParadise</title>
    <description>The latest articles on Forem by DevParadise (@devsparadise).</description>
    <link>https://forem.com/devsparadise</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%2Forganization%2Fprofile_image%2F3031%2F2be44855-21db-4449-ac60-52a7090a5608.jpg</url>
      <title>Forem: DevParadise</title>
      <link>https://forem.com/devsparadise</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devsparadise"/>
    <language>en</language>
    <item>
      <title>Redisgraph - Deep Dive Part 1</title>
      <dc:creator>Kisore Subburaman</dc:creator>
      <pubDate>Sat, 26 Sep 2020 07:34:13 +0000</pubDate>
      <link>https://forem.com/devsparadise/redisgraph-deep-dive-part-1-2908</link>
      <guid>https://forem.com/devsparadise/redisgraph-deep-dive-part-1-2908</guid>
      <description>&lt;h1&gt;
  
  
  RedisInsight
&lt;/h1&gt;

&lt;p&gt;Hey guys! This is the second part of Redisgraph series. As we talked about RedisInsight earlier, it is a GUI for redis application. We can view the graphical representation of our data. Here, &lt;a href="https://docs.redislabs.com/latest/ri/installing/install-redis-desktop/" rel="noopener noreferrer"&gt;Install RedisInsight&lt;/a&gt; contains the steps for installation. &lt;br&gt;
  Once installed, run your redis server and redis insight, navigate to &lt;a href="http://127.0.0.1:8001/" rel="noopener noreferrer"&gt;http://127.0.0.1:8001/&lt;/a&gt;. You will visit the home page of redis insight, there you can create a new database for your project as mentioned below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj6mmr0kbxmqlm1onojub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj6mmr0kbxmqlm1onojub.png" alt="Alt Text" width="690" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, a database is created, you can navigate into it. In the sidebar, you can find Redisgraph, get into it. There, you can run commands and execute them. Both graphical and JSON notation of data is available. &lt;/p&gt;
&lt;h4&gt;
  
  
  CREATE
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3eax7n8hbo2vajtg2zmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3eax7n8hbo2vajtg2zmv.png" alt="Alt Text" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  MATCH
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbx92kw4729swgbi4qv6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbx92kw4729swgbi4qv6x.png" alt="Alt Text" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we can see some of the commands withdrawing the example we had from our last tutorial, &lt;/p&gt;
&lt;h3&gt;
  
  
  SKIP
&lt;/h3&gt;

&lt;p&gt;It is used when we deal with batches of records. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;syntax: SKIP [number of records to be skipped]&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) RETURN e SKIP 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It skips the first 10 records and returns the rest. &lt;/p&gt;

&lt;h3&gt;
  
  
  LIMIT
&lt;/h3&gt;

&lt;p&gt;It is used to limit the number of records. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;syntax: LIMIT [maximum number of records to be retrieved]&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) RETURN e LIMIT 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns only the first 10 records present. &lt;/p&gt;

&lt;p&gt;SKIP and LIMIT together&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) RETURN e SKIP 10 LIMIT 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It skips the first 10 records and lists the next 10. &lt;/p&gt;

&lt;h3&gt;
  
  
  ORDER BY
&lt;/h3&gt;

&lt;p&gt;It denotes the sorting option [ASC/DESC]. We can specify how the records have to be sorted.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;syntax: ORDER BY [field name] [ASC/DESC]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we want to retrieve records with sorting names of employees ascending order(default).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) RETURN e ORDER BY e.name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For descending,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) RETURN e ORDER BY e.designation DESC;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>redis</category>
      <category>webdev</category>
      <category>database</category>
      <category>redisgraph</category>
    </item>
    <item>
      <title>Intro to Redisgraph</title>
      <dc:creator>Kisore Subburaman</dc:creator>
      <pubDate>Thu, 17 Sep 2020 14:33:53 +0000</pubDate>
      <link>https://forem.com/devsparadise/intro-to-redisgraph-3g23</link>
      <guid>https://forem.com/devsparadise/intro-to-redisgraph-3g23</guid>
      <description>&lt;p&gt;Hey guys! This is a series about &lt;strong&gt;RedisGraph&lt;/strong&gt;. For the people out there who are new to this term, it is the first queryable Property Graph database to use sparse matrices to represent the adjacency matrix in graphs and linear algebra to query the graph. Don't panic, it is not as difficult as it seems, in a nutshell, it is a graph-based database where we're going to handle data through nodes and relationships. For guys who have worked in Neo4j, this would be a piece of cake.You can visit the official site here  &lt;a href="https://oss.redislabs.com/redisgraph/" rel="noopener noreferrer"&gt;Redisgraph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's see the primary features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It is based on the Property Graph Model.&lt;/li&gt;
&lt;li&gt;Nodes are treated as vertices and edges are treated as relationships, that may have attributes.&lt;/li&gt;
&lt;li&gt;Nodes can be labeled.&lt;/li&gt;
&lt;li&gt;Relationships have a relationship type.&lt;/li&gt;
&lt;li&gt;Graphs are represented as sparse adjacency matrices, Cypher as a query language&lt;/li&gt;
&lt;li&gt;Cypher queries are translated into linear algebra expressions&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Setting up redisgraph
&lt;/h1&gt;

&lt;p&gt;You can find the installation and setup process here &lt;a href="https://oss.redislabs.com/redisgraph/#building" rel="noopener noreferrer"&gt;Setup Redisgraph&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why should I use Redisgraph?
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster&lt;/strong&gt; : Redisgraph provides faster access and retrieval of data. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Straightforward&lt;/strong&gt; : Since it is based on nodes and relations, it is not a hard nut to crack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Understandable&lt;/strong&gt; : Queries are simple commands and clear. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Visual view&lt;/strong&gt; : To interact with data visually, Redislabs provides a service &lt;a href="https://redislabs.com/redis-enterprise/redis-insight/?utm_source=google&amp;amp;utm_medium=paid-search&amp;amp;utm_term=redisinsight&amp;amp;utm_content=458400925344&amp;amp;utm_campaign=brand-intl-israelandindia-in-en&amp;amp;gclid=CjwKCAjwkoz7BRBPEiwAeKw3q36HB6z3H9Bpv09vT0S03Q_Amp4rq5SnCI4FWQtv0Ss8k387jP_42RoC6LcQAvD_BwE" rel="noopener noreferrer"&gt;RedisInsight&lt;/a&gt;, we will dig deeper into that service later in our tutorial. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Supported Datatypes
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Integer&lt;/li&gt;
&lt;li&gt;NULL&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Double&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Let's get our hands dirty
&lt;/h1&gt;

&lt;p&gt;We take an example of creating employees of an organization and perform CRUD.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CREATE&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    CREATE (e:emp{id:1, name: 'John', age: '24', designation: 'developer'}) RETURN e;

    CREATE (e:emp{id:2, name: 'Jessie', age: '27', designation: 'tester'}) RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;br&gt;
    * e      -   alias of the emp, we can use it within this entire command anywhere we needed.&lt;br&gt;
    * emp   -   name of the node.&lt;br&gt;
    * data will be given as key-value pair (object).&lt;br&gt;
    * RETURN - return the data after creation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MATCH&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It matches all docs(documents) when no condition is given explicitly and when given, it retrieves only the docs matching the condition.&lt;/p&gt;

&lt;p&gt;To return the list of all employees&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; MATCH (e:emp) RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fetch on condition basis&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp{id:1}) RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OR&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) WHERE e.id = 1 RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both ways returns the doc of an employee having id 1. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SET&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To update a single property&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; MATCH (e:emp{id: 1}) SET e.age=28 RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To update more than one property&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp{id: 1}) SET e.age=28,e.designation=’senior developer’ RETURN e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DELETE&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To delete based on condition&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp{id:2}) DELETE e;   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom! It deletes the employee with id 2.&lt;br&gt;
 To delete all the docs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (e:emp) DELETE e;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>redis</category>
      <category>webdev</category>
      <category>redisgraph</category>
      <category>database</category>
    </item>
  </channel>
</rss>
