<?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: Ratik Mahajan</title>
    <description>The latest articles on DEV Community by Ratik Mahajan (@ranujmahajan).</description>
    <link>https://dev.to/ranujmahajan</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%2F639244%2F67c9faf0-7366-4f1e-afb4-327b7d250bc4.jpeg</url>
      <title>DEV Community: Ratik Mahajan</title>
      <link>https://dev.to/ranujmahajan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ranujmahajan"/>
    <language>en</language>
    <item>
      <title>How does global Load balancer works</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Tue, 07 Oct 2025 14:58:42 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/how-does-global-load-balancer-works-4o3b</link>
      <guid>https://dev.to/ranujmahajan/how-does-global-load-balancer-works-4o3b</guid>
      <description>&lt;p&gt;How does Load Balancer works? &lt;/p&gt;

&lt;p&gt;Load balancer uses an algorithm to forward the request to the different based on some filters. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CPU based algorithm &lt;/li&gt;
&lt;li&gt;round robin technique&lt;/li&gt;
&lt;li&gt;Load balancer also keeps the  heart beat to check if services connected to it are working fine.&lt;/li&gt;
&lt;li&gt;global load balancers distributes the request based on IP and geographical locations. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;![ ](&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9r3klrv9627ue7yqdyn.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9r3klrv9627ue7yqdyn.png&lt;/a&gt;&lt;/p&gt;

</description>
      <category>loadbalancer</category>
      <category>systemdesign</category>
      <category>datacentre</category>
    </item>
    <item>
      <title>Mardown to the PDF converter.</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Mon, 15 Sep 2025 15:41:27 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/mardown-to-the-pdf-converter-n8e</link>
      <guid>https://dev.to/ranujmahajan/mardown-to-the-pdf-converter-n8e</guid>
      <description>&lt;p&gt;&lt;a href="https://pdffrommarkdown.com" rel="noopener noreferrer"&gt;https://pdffrommarkdown.com&lt;/a&gt; is the place where you can convert your markdown files to pdf . &lt;br&gt;
you can give your custom names to the pdf and you can encrypt them with password as well. &lt;/p&gt;

</description>
      <category>markdown</category>
      <category>pdf</category>
      <category>markdownconverter</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Improve your understanding of SOLID principles in OOPS.</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Mon, 26 Aug 2024 07:38:02 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/improve-your-understanding-of-solid-principles-in-oops-29cf</link>
      <guid>https://dev.to/ranujmahajan/improve-your-understanding-of-solid-principles-in-oops-29cf</guid>
      <description>&lt;p&gt;What Does Solid principles mean ?  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S-&amp;gt; Single responsibility principle&lt;/strong&gt; 
: it states that a class or an object in the OOPS programming realm should carry only one responsibility. if there are actions that are taken by student&lt;/li&gt;
&lt;li&gt;pay for the fees&lt;/li&gt;
&lt;li&gt;enrolment to new course&lt;/li&gt;
&lt;li&gt;subjects studying&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Assume we can create a class with all the responsibility encapsulated in student class, but that would make our code complex and difficult to maintain. &lt;/p&gt;

&lt;p&gt;we have to separate the concerns and make sure that each class is only responsible for one task . this way each class will perform task.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtwlzpvmprneagsgt92p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtwlzpvmprneagsgt92p.png" alt="Single responsibility principle" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O-&amp;gt; &lt;strong&gt;Open and closed principle&lt;/strong&gt; : &lt;br&gt;
This principle states that we should not change existing functionality or program in the class. we can extend our functionality of the class, but we shouldn't be able to modify it. &lt;/p&gt;

&lt;p&gt;this looks really easy while we write it in theory, but we have to think of creating interface and make sure that we  even if new classes are added, they implement from the interface and are able to execute the existing core logic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxp3fuimoy9lz5if8r46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faxp3fuimoy9lz5if8r46.png" alt="open/ closed principle " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why do we need a NoSQL Databases</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Tue, 23 Jul 2024 13:16:57 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/why-do-we-need-a-nosql-databases-2eef</link>
      <guid>https://dev.to/ranujmahajan/why-do-we-need-a-nosql-databases-2eef</guid>
      <description>&lt;p&gt;In this post, I would explain why do we need NoSQL databases from a developer perspective. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developer Friendly&lt;/strong&gt; : NoSql databases are developer friendly, we can store JSON that is generated from the UI to the database, there is no transformation required at the application server end. this data can be read through a key from the database. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data schema&lt;/strong&gt;: we can store Json documents of different format in the collection. we dont have to comply to the any data schema. data of different schema's can be stored in the collection. this ensures that a very less transformation or no transformation is required for the data retrieval and data storage. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NoSql horizontal scaling&lt;/strong&gt; : it can store huge amount of data. Nosql data can be scaled out easily. as data grows, we can add more and more servers to the Nosql databases. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nosql</category>
      <category>database</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Why do we need NoSql Database</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Thu, 18 Jul 2024 10:48:53 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/why-do-we-need-nosql-database-1471</link>
      <guid>https://dev.to/ranujmahajan/why-do-we-need-nosql-database-1471</guid>
      <description>&lt;p&gt;Data is new oil, we need database management technique to store the data of the application. data can be categorised into two types&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Relational data : this data has relations and is required for the transaction. it is really time consuming or not easy to horizontal scale SQL data though not impossible( so we need NOSQL data to scale our data management system easily)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;Below are some important reason why we need NoSql Databases&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Nosql databases are easily scalable&lt;/strong&gt;&lt;/em&gt;, do you why are they scalable, because data is not dependent on each other. so i give you an example if you store 1000 movies in your hard drive and create a index somewhere to get the movies from the harddrive, you can store another 1200 movies in other harddrives and scale it. so as movie storage grow, you can buy a storage and create an index, this is the case with nosql databases, as data grow, you can buy a NoSql database and start experimenting with our data. this is very important. we need quick data and we need less overhead if data grows exponentially. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;data can grow exponentially while application is running, we can do sharding on the data. we will use shards and each shards will store some kind of common data. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NoSQL system support security, you can use kerberos, password based and encryption algorithms to the NoSql database. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;latency, if we have data that is scattered across the server, then we may need to create an index . we can create an index on nosql servers as well, index is nothing complex but is a lookup, how we will search for an data . nosql databases if properly managed can reduce latency and respond super fast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fault tolerance and high availability: these database are well suitable for the cloud and distributed environments, they are highly available. if in case any node or any system is down, nosql databases recover well on time. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cache</category>
      <category>systems</category>
      <category>systemdesign</category>
      <category>nosql</category>
    </item>
    <item>
      <title>Cache in System Design</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 24 Apr 2024 07:45:18 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/cache-in-system-design-27nc</link>
      <guid>https://dev.to/ranujmahajan/cache-in-system-design-27nc</guid>
      <description>&lt;h2&gt;
  
  
  What is Cache:
&lt;/h2&gt;

&lt;p&gt;Cache is the storage area, where data is stored very close for processing. when we cache data, it would mean that data is available very close. this would improve the performance of the computer systems. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need cache
&lt;/h2&gt;

&lt;p&gt;We need cache for several reasons. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;we need cache to improve the performance of an application. &lt;/li&gt;
&lt;li&gt;we need cache to reduce timeout in the appication. &lt;/li&gt;
&lt;li&gt;cache would help in reducing network trips &lt;/li&gt;
&lt;li&gt;cache would reduce Disk I/O operations. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to use cache ?
&lt;/h2&gt;

&lt;p&gt;Most common strategy that we often use with cache is lazy loading, if data is present in cache, it would be cache hit and application can use that data to process the request. &lt;br&gt;
if data is not present in the cache, it would result in the cache miss and then data is fetched into the cache. &lt;/p&gt;

</description>
      <category>cache</category>
      <category>systemdesign</category>
      <category>cachestudy</category>
      <category>design</category>
    </item>
    <item>
      <title>Why do we need java 8 ?</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 20 Mar 2024 15:30:22 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/why-do-we-need-java-8--1e4j</link>
      <guid>https://dev.to/ranujmahajan/why-do-we-need-java-8--1e4j</guid>
      <description>&lt;p&gt;below are the reasons why did we need java 8 : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;java 8 has introduced functional programming capabilities in java&lt;/li&gt;
&lt;li&gt;with java 8 we can use the concurrent core of the CPU and use it to the maximum power. &lt;/li&gt;
&lt;li&gt;a special object iterator that lets use use the collection of the objects in the functional manner. &lt;/li&gt;
&lt;li&gt;code was more usable and readable in java 8. &lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>What is Functional Interface in java</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Tue, 12 Mar 2024 14:00:30 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/what-is-functional-interface-in-java-1j4f</link>
      <guid>https://dev.to/ranujmahajan/what-is-functional-interface-in-java-1j4f</guid>
      <description>&lt;p&gt;Functional interface are used in java to make java a functional language : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;functions to be used as higher order citizens. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have a question here with you guys, how do call a function in the java. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;create a function in the class, create an class object and then call the function from the class object.&lt;/li&gt;
&lt;li&gt;create a static function on the class and call the function. &lt;/li&gt;
&lt;li&gt;&lt;p&gt;you always have to put it to a class, now you can create a function with the reference of the interface. &lt;br&gt;
steps to create function through functional interface&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create a function interface, create a function signature . &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create an object of this interface and call the funtion with signature mentioned in the function interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;this function can be passed in java in parameters of the function who would accept the type function interface. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;below is the code for the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.sorting;

public class UseFunctionInterface {
    public static void main(String[] args) {
        CalculateSquare calculateSquare = (number) -&amp;gt; number * number;
        calculateSquare.square(4);
    }


}

@FunctionalInterface
interface CalculateSquare {
    int square(int number);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Program to reverse a string in java</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 21 Feb 2024 13:42:35 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/program-to-reverse-a-string-in-java-2pch</link>
      <guid>https://dev.to/ranujmahajan/program-to-reverse-a-string-in-java-2pch</guid>
      <description>&lt;h2&gt;
  
  
  Reverse a String in java Explanation : pseudo Code
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Convert the string to array of characters. &lt;/li&gt;
&lt;li&gt;add all the characters to the stack &lt;/li&gt;
&lt;li&gt;create an object of the StringBuilder class and keep on adding the stack characters to the StringBuilder object. &lt;/li&gt;
&lt;li&gt;convert string builder to the string.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; public static String reverseString(String word) {
        Stack&amp;lt;Character&amp;gt; charStack = new Stack&amp;lt;&amp;gt;();
        for (char ch : word.toCharArray()) {
            charStack.push(ch);
        }
        StringBuilder sbString = new StringBuilder();
        while (!charStack.isEmpty()) {
            sbString.append(charStack.pop());
        }
        return sbString.toString();
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
    </item>
    <item>
      <title>Java String Programs</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 21 Feb 2024 13:39:12 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/java-string-programs-4575</link>
      <guid>https://dev.to/ranujmahajan/java-string-programs-4575</guid>
      <description>&lt;h2&gt;
  
  
  Java String Programs
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/ranujmahajan/program-to-reverse-a-string-in-java-2pch"&gt;Java program to reverse a string&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javastring</category>
      <category>programming</category>
      <category>stringprogram</category>
      <category>java</category>
    </item>
    <item>
      <title>Strings in java language</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 21 Feb 2024 13:35:10 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/strings-in-java-language-h6c</link>
      <guid>https://dev.to/ranujmahajan/strings-in-java-language-h6c</guid>
      <description>&lt;h2&gt;
  
  
  Java strings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Java Strings are &lt;strong&gt;array of characters&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;  Java Strings are immutable : which means once Strings are created in the String pool they can't be changed.&lt;/li&gt;
&lt;li&gt; Strings were earlier stored in Permgen and from java 7 onwards strings in java are stored in the heap. this makes string available for the garbage collection if it is not referenced anywhere in the memory. &lt;/li&gt;
&lt;li&gt;Strings in java are created through new keyword and java String literals. Strings created through new keyword are stored in heap and Strings created through literals are stored in the string pool(heap) from java 7 onwards. String pool would mean intern of the string. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why do we intern Strings in java
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This reduces the memory footprint of string in java. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>javastring</category>
      <category>strings</category>
      <category>programming</category>
    </item>
    <item>
      <title>Strings in java language</title>
      <dc:creator>Ratik Mahajan</dc:creator>
      <pubDate>Wed, 21 Feb 2024 13:35:04 +0000</pubDate>
      <link>https://dev.to/ranujmahajan/strings-in-java-language-4lc8</link>
      <guid>https://dev.to/ranujmahajan/strings-in-java-language-4lc8</guid>
      <description>&lt;h2&gt;
  
  
  Java strings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Java Strings are &lt;strong&gt;array of characters&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;  Java Strings are immutable : which means once Strings are created in the String pool they can't be changed.&lt;/li&gt;
&lt;li&gt; Strings were earlier stored in Permgen and from java 7 onwards strings in java are stored in the heap. this makes string available for the garbage collection if it is not referenced anywhere in the memory. &lt;/li&gt;
&lt;li&gt;Strings in java are created through new keyword and java String literals. Strings created through new keyword are stored in heap and Strings created through literals are stored in the string pool(heap) from java 7 onwards. String pool would mean intern of the string. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why do we intern Strings in java
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This reduces the memory footprint of string in java. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>javastring</category>
      <category>strings</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
