<?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: Prathamesh Lakare</title>
    <description>The latest articles on DEV Community by Prathamesh Lakare (@prathamesh_lakare_6cbf1a2).</description>
    <link>https://dev.to/prathamesh_lakare_6cbf1a2</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%2F2667730%2F82763819-8fd3-47b8-8115-dedb8be39268.jpg</url>
      <title>DEV Community: Prathamesh Lakare</title>
      <link>https://dev.to/prathamesh_lakare_6cbf1a2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prathamesh_lakare_6cbf1a2"/>
    <language>en</language>
    <item>
      <title>SQL vs NoSQL</title>
      <dc:creator>Prathamesh Lakare</dc:creator>
      <pubDate>Thu, 22 May 2025 13:34:49 +0000</pubDate>
      <link>https://dev.to/prathamesh_lakare_6cbf1a2/sql-vs-nosql-58mg</link>
      <guid>https://dev.to/prathamesh_lakare_6cbf1a2/sql-vs-nosql-58mg</guid>
      <description>&lt;p&gt;Yesterday I had a session with Ankita Tripathi. It was a really great session, and I learned a lot about SQL databases and NoSQL databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Understand from SQL vs NoSQL
&lt;/h2&gt;




&lt;h3&gt;
  
  
  SQL (Structured Query Language)
&lt;/h3&gt;

&lt;p&gt;SQL is a database that stores data in a &lt;strong&gt;vertical&lt;/strong&gt; way. In SQL databases, you store data in the form of &lt;strong&gt;rows and columns&lt;/strong&gt;. The first row contains fields, and the next rows contain data for those fields. So, it's like adding data vertically.&lt;/p&gt;

&lt;p&gt;SQL is mostly used in applications where you &lt;strong&gt;already know the structure&lt;/strong&gt; of the data (i.e., fields) before storing it. For example, if you want to store &lt;strong&gt;user data&lt;/strong&gt; or &lt;strong&gt;banking data&lt;/strong&gt;, you can use a SQL database.&lt;/p&gt;




&lt;h3&gt;
  
  
  NoSQL (Not Only SQL)
&lt;/h3&gt;

&lt;p&gt;NoSQL is a database that stores data in a &lt;strong&gt;horizontal&lt;/strong&gt; way. In this, data is stored in &lt;strong&gt;JSON format&lt;/strong&gt;, and you can have as many fields as you want. It is generally &lt;strong&gt;faster&lt;/strong&gt; compared to SQL.&lt;/p&gt;

&lt;p&gt;When you have &lt;strong&gt;dynamic data&lt;/strong&gt; with &lt;strong&gt;multiple fields&lt;/strong&gt;, you use a NoSQL database. For example, when storing &lt;strong&gt;product data&lt;/strong&gt;, you use NoSQL. It stores data in the form of JSON and keeps adding new fields as needed, which makes it scalable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Flipkart
&lt;/h3&gt;

&lt;p&gt;Most of the data in Flipkart is stored using NoSQL. That's because it has many products with different categories and different data structures. If SQL were used here, it would get very complicated. For example, in the mobile category, you might see fields like &lt;strong&gt;screen size&lt;/strong&gt; and &lt;strong&gt;accessories&lt;/strong&gt;, whereas in the clothing category, you see &lt;strong&gt;size&lt;/strong&gt; and &lt;strong&gt;color&lt;/strong&gt;. NoSQL handles this easily.&lt;/p&gt;

&lt;h3&gt;
  
  
  Netflix
&lt;/h3&gt;

&lt;p&gt;Netflix uses a &lt;strong&gt;hybrid model&lt;/strong&gt;, which means it uses both SQL and NoSQL. When it comes to data like &lt;strong&gt;recommendations&lt;/strong&gt; or &lt;strong&gt;watch-later lists&lt;/strong&gt;, NoSQL is used because it's faster when dynamic tasks are happening. But for things like &lt;strong&gt;user data&lt;/strong&gt; or &lt;strong&gt;payment data&lt;/strong&gt;, SQL is used since it provides better insights and structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uber (Ride Sharing)
&lt;/h3&gt;

&lt;p&gt;Uber also uses a NoSQL database because there are frequent changes in fields with different categories. For example, if Uber introduces a new feature like &lt;strong&gt;pool sharing&lt;/strong&gt; or &lt;strong&gt;bus rides&lt;/strong&gt;, with SQL they would have to create new fields manually, which can make the app unscalable. But with NoSQL, it's easier to add new features with different fields. Also, for real-time ride locations, faster data access is needed, which NoSQL provides.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why We Use SQL
&lt;/h2&gt;

&lt;p&gt;SQL stores data in rows and columns, which makes it easier to generate insights like &lt;strong&gt;charts and reports&lt;/strong&gt;. It is great for structured data like &lt;strong&gt;banking systems&lt;/strong&gt; where all fields are required. If one field is null, it throws an error — which is actually useful when you want to make sure all information is filled in.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why We Use NoSQL
&lt;/h2&gt;

&lt;p&gt;NoSQL stores data in JSON format, and you can add fields anytime. It's flexible and works well when you're &lt;strong&gt;adding new features&lt;/strong&gt; or when &lt;strong&gt;speed&lt;/strong&gt; is important. Operations in NoSQL are generally faster, and it allows you to update or insert new fields easily without changing the overall structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  CAP Theorem
&lt;/h2&gt;

&lt;p&gt;CAP Theorem is a fundamental concept used in distributed systems. It gives &lt;strong&gt;three guarantees&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Returns the most recent data or an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt;: Every request receives a response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Tolerance&lt;/strong&gt;: The system keeps working even if there are network issues.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  According to the Theorem
&lt;/h3&gt;

&lt;p&gt;A distributed system &lt;strong&gt;must tolerate partitions&lt;/strong&gt;. It can only choose one of the other two — &lt;strong&gt;consistency&lt;/strong&gt; or &lt;strong&gt;availability&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CP&lt;/strong&gt;: System prefers &lt;strong&gt;consistency&lt;/strong&gt; over &lt;strong&gt;availability&lt;/strong&gt; (like NoSQL databases).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AP&lt;/strong&gt;: System prefers &lt;strong&gt;availability&lt;/strong&gt; over &lt;strong&gt;consistency&lt;/strong&gt; (like SQL databases).&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Understanding the Virtual DOM in React</title>
      <dc:creator>Prathamesh Lakare</dc:creator>
      <pubDate>Mon, 12 May 2025 06:32:23 +0000</pubDate>
      <link>https://dev.to/prathamesh_lakare_6cbf1a2/understanding-the-virtual-dom-in-react-2nni</link>
      <guid>https://dev.to/prathamesh_lakare_6cbf1a2/understanding-the-virtual-dom-in-react-2nni</guid>
      <description>&lt;p&gt;React is fast — but &lt;strong&gt;how&lt;/strong&gt; is it so fast? One of the biggest reasons is the &lt;strong&gt;Virtual DOM&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the DOM?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;DOM (Document Object Model)&lt;/strong&gt; is a tree-like structure representing the HTML elements on a web page. Whenever you change something (like text or style), the DOM has to update, which can be slow if not handled properly.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the Virtual DOM?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Virtual DOM&lt;/strong&gt; is a &lt;strong&gt;lightweight copy&lt;/strong&gt; of the real DOM that React keeps in memory.&lt;/p&gt;

&lt;p&gt;Instead of directly updating the real DOM every time something changes, React updates the Virtual DOM first, then compares it with the previous Virtual DOM (this process is called &lt;strong&gt;diffing&lt;/strong&gt;). React then finds out what actually changed and updates &lt;strong&gt;only those parts&lt;/strong&gt; of the real DOM.&lt;/p&gt;

&lt;p&gt;This makes the whole process &lt;strong&gt;faster and more efficient&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  How React Uses Virtual DOM
&lt;/h2&gt;

&lt;p&gt;Here's a simple breakdown:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You change the state or props in your component.&lt;/li&gt;
&lt;li&gt;React creates a new Virtual DOM tree.&lt;/li&gt;
&lt;li&gt;It compares the new Virtual DOM with the old one.&lt;/li&gt;
&lt;li&gt;React finds the differences (called “diffing”).&lt;/li&gt;
&lt;li&gt;React updates &lt;strong&gt;only the changed nodes&lt;/strong&gt; in the real DOM.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is much faster than re-rendering the entire DOM.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why is Virtual DOM Better?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
React avoids unnecessary real DOM updates, which are expensive and slow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Efficient Re-rendering&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Only the parts of the UI that actually change get updated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smooth UI&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Your app feels fast and responsive, even with many components.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding the JavaScript Event Loop</title>
      <dc:creator>Prathamesh Lakare</dc:creator>
      <pubDate>Mon, 12 May 2025 05:25:03 +0000</pubDate>
      <link>https://dev.to/prathamesh_lakare_6cbf1a2/understanding-the-javascript-event-loop-3lh7</link>
      <guid>https://dev.to/prathamesh_lakare_6cbf1a2/understanding-the-javascript-event-loop-3lh7</guid>
      <description>&lt;p&gt;If you've ever wondered how JavaScript handles asynchronous tasks like &lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;fetch&lt;/code&gt;, or &lt;code&gt;Promises&lt;/code&gt; while being a single-threaded language—you're not alone.&lt;/p&gt;




&lt;h2&gt;
  
  
  How JavaScript Executes Code
&lt;/h2&gt;

&lt;p&gt;JavaScript runs in the browser using a JavaScript engine. When your code executes, it goes into the &lt;strong&gt;call stack&lt;/strong&gt;, which handles &lt;strong&gt;synchronous&lt;/strong&gt; tasks—code that runs line by line.&lt;/p&gt;

&lt;p&gt;But when there's asynchronous code, things work a bit differently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Web APIs
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;browser&lt;/strong&gt; provides &lt;strong&gt;Web APIs&lt;/strong&gt; to handle asynchronous operations.&lt;/p&gt;

&lt;p&gt;When such code runs, it's sent off to the Web API environment provided by the browser—not the call stack. Once the asynchronous operation is complete, its callback is moved to the &lt;strong&gt;callback queue&lt;/strong&gt; (or task queue).&lt;/p&gt;




&lt;h2&gt;
  
  
  Microtasks vs Macrotasks
&lt;/h2&gt;

&lt;p&gt;Not all tasks in the callback queue are treated equally.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Microtasks&lt;/strong&gt;: &lt;code&gt;Promises&lt;/code&gt;, &lt;code&gt;queueMicrotask&lt;/code&gt;, &lt;code&gt;MutationObserver&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Macrotasks&lt;/strong&gt;: &lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;, &lt;code&gt;setImmediate&lt;/code&gt;, UI rendering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Microtasks have higher priority&lt;/strong&gt; and are always executed before macrotasks in each cycle of the event loop.&lt;/p&gt;




&lt;h2&gt;
  
  
  Event Loop
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;event loop&lt;/strong&gt; is the behind-the-scenes mechanism that keeps everything running smoothly.&lt;/p&gt;

&lt;p&gt;It constantly checks: Is the call stack empty?&lt;/p&gt;

&lt;p&gt;If yes, it picks the first task from the &lt;strong&gt;callback queue&lt;/strong&gt; (starting with microtasks) and moves it into the &lt;strong&gt;call stack&lt;/strong&gt; for execution.&lt;/p&gt;

&lt;p&gt;This is how JavaScript handles asynchronous code without blocking the main thread.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>eventloop</category>
    </item>
    <item>
      <title>A Journey Through Time: The History of Web Applications</title>
      <dc:creator>Prathamesh Lakare</dc:creator>
      <pubDate>Fri, 10 Jan 2025 06:42:50 +0000</pubDate>
      <link>https://dev.to/prathamesh_lakare_6cbf1a2/a-journey-through-time-the-history-of-web-applications-32p9</link>
      <guid>https://dev.to/prathamesh_lakare_6cbf1a2/a-journey-through-time-the-history-of-web-applications-32p9</guid>
      <description>&lt;p&gt;Modern web applications are often built as Single Page Applications (SPAs). But if we look back at the history of web development, things were quite different.&lt;/p&gt;

&lt;p&gt;In the past, web applications rendered all their content on the server-side. This meant the server sent fully prepared HTML, CSS, and JavaScript files to the browser for each request. The browser would then display the content by rendering these files.&lt;/p&gt;

&lt;p&gt;A great example of this approach, which still exists today, is Wikipedia. When you visit Wikipedia, all the content for the requested page is loaded upfront. If you disconnect your internet after the page loads, you'll still be able to view the content because everything, including the HTML, CSS, and JavaScript, has already been delivered to your browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  However, server-rendered applications like this come with some downsides:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Memory Usage: These apps often consume more memory, which can lead to slower device performance, especially on resource-constrained devices.&lt;/li&gt;
&lt;li&gt;Performance Bottlenecks: Every time you navigate to a new page, the browser makes a new request, and the server sends the entire page again, resulting in slower load times compared to modern SPAs.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  In contrast, modern SPAs work differently:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When you visit an SPA, the server sends a minimal HTML file along with bundled JavaScript and CSS files.&lt;/li&gt;
&lt;li&gt;The browser uses these files to dynamically render content on the page, often fetching additional data via APIs without refreshing the whole page.&lt;/li&gt;
&lt;li&gt;This reduces the load on devices and servers, making the experience smoother and faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  To understand how traditional server-rendered apps work, think of the process like this:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The server receives the URL of the page you want to visit.&lt;/li&gt;
&lt;li&gt;It processes the request and sends the full set of files (HTML, CSS, JS) to the browser.&lt;/li&gt;
&lt;li&gt;The browser interprets these files to generate the content you see on the screen.&lt;/li&gt;
&lt;li&gt;In these apps, the server doesn’t directly send the content you see. It sends the files required to create that content. The browser is responsible for converting those files into the visual layout and interactions on the webpage.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
  </channel>
</rss>
