<?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: Kisore Subburaman</title>
    <description>The latest articles on DEV Community by Kisore Subburaman (@kisore99).</description>
    <link>https://dev.to/kisore99</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%2F424364%2F514173ca-5d0f-4de7-82f0-75937224e8cc.jpeg</url>
      <title>DEV Community: Kisore Subburaman</title>
      <link>https://dev.to/kisore99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kisore99"/>
    <language>en</language>
    <item>
      <title>Why Redis? An Intro with Practical Use Cases for Developers</title>
      <dc:creator>Kisore Subburaman</dc:creator>
      <pubDate>Wed, 06 Nov 2024 17:48:36 +0000</pubDate>
      <link>https://dev.to/kisore99/why-redis-an-intro-with-practical-use-cases-for-developers-3kfj</link>
      <guid>https://dev.to/kisore99/why-redis-an-intro-with-practical-use-cases-for-developers-3kfj</guid>
      <description>&lt;h2&gt;
  
  
  Redis Introduction
&lt;/h2&gt;

&lt;p&gt;Redis is an in-memory data structure store that supports multiple data types, making it a top choice for many developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Major usage&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Session management&lt;/li&gt;
&lt;li&gt;Rate Limiting&lt;/li&gt;
&lt;li&gt;Message Broker &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Supported Data Types&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Hash&lt;/li&gt;
&lt;li&gt;List&lt;/li&gt;
&lt;li&gt;Set&lt;/li&gt;
&lt;li&gt;Sorted set&lt;/li&gt;
&lt;li&gt;Stream&lt;/li&gt;
&lt;li&gt;Bitmap&lt;/li&gt;
&lt;li&gt;Bitfield&lt;/li&gt;
&lt;li&gt;Geospatial&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Refer redis &lt;a href="https://redis.io/docs/latest/develop/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; which is clean and well structured. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Redis?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Reading and writing data in RAM is several &lt;em&gt;orders of magnitude&lt;/em&gt; faster than on disk, enabling Redis to handle hundreds of thousands to millions of operations per second.&lt;/p&gt;

&lt;p&gt;Redis has a rich set of data structures. These structures enable complex data manipulation and aggregation tasks with minimal code. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Atomicity&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Redis processes all the commands in a single-threaded, event-driven loop which ensures that the commands are executed in the order they are issued. &lt;/p&gt;

&lt;p&gt;Redis offers atomic operations at the data structure level. &lt;br&gt;
For example: If two clients concurrently execute &lt;code&gt;INCR&lt;/code&gt; command on the same key, Redis ensures that the value is correctly incremented twice without any lost increments. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Transactional&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Redis supports transactions using &lt;code&gt;MULTI&lt;/code&gt; and &lt;code&gt;EXEC&lt;/code&gt; commands. It allows a list of commands to be queued and executed atomically. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MULTI&lt;/code&gt; starts a transaction&lt;/li&gt;
&lt;li&gt;Any commands issued after &lt;code&gt;MULTI&lt;/code&gt; will be queued and not executed immediately&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EXEC&lt;/code&gt; executes all commands atomically as a single batch&lt;/li&gt;
&lt;li&gt;Note that if any command fails, the remaining commands in the transaction still execute. Redis does not support rollback. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Rate Limiting&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Think about when your boss dumps a mountain of work on you in no time. You would be exhausted, maybe even seeing stars, right? While we can complain about it, networks don’t have that option—they just slow down and struggle! So, if we get tired from overload, it’s fair to say networks need a breather too! &lt;/p&gt;

&lt;p&gt;Rate limiting is a technique which controls the follow of traffic by limiting the number of requests made to a network, server, or resource in a given time frame. It prevents users from exhausting network resources. &lt;/p&gt;

&lt;p&gt;A rate-limited application signals users to slow down rather than overwhelming it with too many requests. It’s like traffic officers stopping speeding drivers—this isn't ideal for the fast driver (here, the user has to wait after hitting a certain limit) or for other drivers on the same road (other users trying to access the same resource). Rate limiting ensures smoother access for everyone.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Types of rate limits&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Rate limit can be implemented based on the business objective and level of restriction required. There are 3 common types. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User rate limits&lt;/strong&gt;: It monitors the number of requests made by a user by tracking IP address or API key. Users who have hit the threshold value are notified and denied for further requests until the timeframe resets. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Geographic rate limits&lt;/strong&gt;: It relies on detecting user's location through IP address or geolocation APIs. By applying different rate limits to various geographic regions, developers can prioritize certain areas or reduce traffic from regions known for abusive behavior. For instance, some applications restrict access or enforce stricter rate limits from countries associated with a high frequency of &lt;a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/" rel="noopener noreferrer"&gt;DDoS&lt;/a&gt; or &lt;a href="https://www.cloudflare.com/learning/bots/brute-force-attack/" rel="noopener noreferrer"&gt;brute-force attacks&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server rate limits&lt;/strong&gt;: Developers can set rate limits directly on the server level if they assign specific servers to handle different parts of an application. This approach gives them more flexibility, letting them increase rate limits on frequently used servers while lowering traffic limits on servers that see less action.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>redis</category>
      <category>webdev</category>
      <category>database</category>
      <category>learning</category>
    </item>
    <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://dev.to/devsparadise/redisgraph-deep-dive-part-1-2908</link>
      <guid>https://dev.to/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://dev.to/devsparadise/intro-to-redisgraph-3g23</link>
      <guid>https://dev.to/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>
