<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by KATHISH KUMARAN R  on Medium]]></title>
        <description><![CDATA[Stories by KATHISH KUMARAN R  on Medium]]></description>
        <link>https://medium.com/@kathishcivil94?source=rss-74ab173af0f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_6ZNJ7nxm4v9FHGK</url>
            <title>Stories by KATHISH KUMARAN R  on Medium</title>
            <link>https://medium.com/@kathishcivil94?source=rss-74ab173af0f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:05:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kathishcivil94/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Frontend vs Backend: How Websites Work Behind the Scenes]]></title>
            <link>https://medium.com/@kathishcivil94/frontend-vs-backend-how-websites-work-behind-the-scenes-33789955abae?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/33789955abae</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 04:29:02 GMT</pubDate>
            <atom:updated>2025-06-09T04:29:02.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*oxw4AB7j9P85gRFRae1CJA.gif" /></figure><p><strong>In this article, we are going to learn about the two most important components of any website or web application — the <em>frontend</em> and the <em>backend</em>.</strong> These two parts work together to deliver the experience users see and interact with, as well as the logic and data that power everything behind the scenes.</p><p>Whether you’re browsing a news site, logging into an online store, or using a weather app, you’re engaging with both the frontend (what you see) and the backend (what makes it work). Understanding how these two layers communicate through APIs can give you a better grasp of how modern websites and apps function — and why both are essential.</p><h3>🌐 What is the Frontend?</h3><p>The <strong>frontend</strong> is everything you see and interact with on a website or app. It includes:</p><ul><li>Buttons</li><li>Text</li><li>Images</li><li>Layouts</li><li>Animations</li><li>Color themes and typography</li></ul><p>Think of the frontend as the <strong>presentation layer</strong> — the look and feel of the website. It’s built using technologies like:</p><ul><li><strong>HTML</strong> — for structure</li><li><strong>CSS</strong> — for styling</li><li><strong>JavaScript</strong> — for interactivity</li><li><strong>Frontend frameworks</strong> like React, Vue.js, or Angular</li></ul><p><strong>Example</strong>:<br> When you open an e-commerce website like Amazon, the search bar, the product images, the “Add to Cart” button — all of that is part of the frontend.</p><h3>🧠 What is the Backend?</h3><p>The <strong>backend</strong> is the <strong>brain</strong> behind the frontend. It’s what powers the logic, stores the data, and ensures everything works as expected. Backend handles:</p><ul><li>Storing and retrieving data (e.g., user accounts, orders, product listings)</li><li>Server-side logic (e.g., verifying passwords, processing payments)</li><li>APIs (how the frontend and backend talk)</li><li>Security and performance</li><li>Authentication and authorization</li></ul><p>It’s built using backend languages and frameworks like:</p><ul><li><strong>Python</strong> (e.g., Django, FastAPI)</li><li><strong>Node.js</strong></li><li><strong>PHP</strong></li><li><strong>Java</strong>, <strong>Ruby</strong>, and others</li><li><strong>Databases</strong> like MySQL, PostgreSQL, MongoDB</li></ul><p><strong>Example</strong>:<br> When you log in to your Amazon account, the backend checks your username and password against the database. If they match, it fetches your order history and sends it back to the frontend to display.</p><h3>🔗 How Do Frontend and Backend Communicate?</h3><p>The <strong>frontend and backend communicate</strong> using something called <strong>APIs</strong> (Application Programming Interfaces), most commonly over <strong>HTTP</strong> requests.</p><p>Here’s how it typically works:</p><ol><li><strong>User Action on Frontend</strong>: A user clicks the “Login” button.</li><li><strong>Frontend Sends Request</strong>: JavaScript on the frontend sends a <strong>POST</strong> request to the backend API with the username and password.</li><li><strong>Backend Processes Request</strong>: The backend verifies the credentials with the database.</li><li><strong>Backend Sends Response</strong>: If correct, it sends back user data and a login token.</li><li><strong>Frontend Displays Result</strong>: The frontend receives this data and updates the UI (e.g., “Welcome, John!”)</li></ol><h3>🧪 Real-World Example: A Weather App</h3><p>Let’s break this down with a simple example — a weather forecast web app for an Indian city.</p><h4>✅ Frontend</h4><p>Built using <strong>HTML/CSS/JavaScript</strong>, the frontend includes:</p><ul><li>A search bar to enter a city (e.g., “Chennai”)</li><li>A “Get Weather” button</li><li>A display area for temperature, humidity, and weather conditions</li></ul><h4>🔌 Backend</h4><p>Let’s say the backend is built using <strong>Node.js with Express.js</strong> and connects to a weather API like OpenWeatherMap.</p><p>Here’s what happens:</p><ul><li>The user types <strong>“Chennai”</strong> and clicks “Get Weather”.</li><li>The frontend sends a request to the backend like:<br> GET /weather?city=Chennai</li><li>The backend takes “Chennai”, queries OpenWeatherMap’s API, and gets the latest weather data.</li><li>It processes and returns a JSON response like:</li></ul><pre>{<br>  &quot;city&quot;: &quot;Chennai&quot;,<br>  &quot;temperature&quot;: &quot;34°C&quot;,<br>  &quot;condition&quot;: &quot;Sunny&quot;<br>}</pre><ul><li>The frontend receives this data and updates the UI with:<br> <strong>“The temperature in Chennai is 34°C and it’s currently sunny.”</strong></li></ul><h4>Conclusion</h4><p>Frontend and backend development go hand in hand to create seamless digital experiences. Whether you’re clicking a button or processing a payment, both layers are silently collaborating behind the scenes. By understanding this division of labor, you can better appreciate how your favorite apps function — and even begin building your own.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33789955abae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Access Control: RBAC Vs CASL in NestJS]]></title>
            <link>https://medium.com/@kathishcivil94/demystifying-access-control-rbac-vs-casl-in-nestjs-e1cde782e5c0?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1cde782e5c0</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[rbac]]></category>
            <category><![CDATA[casl]]></category>
            <category><![CDATA[nestjs-tutorial]]></category>
            <category><![CDATA[rbac-access-control]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 05:28:11 GMT</pubDate>
            <atom:updated>2025-06-06T05:28:11.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1amSIhOW2eDOovp9EqJHcQ.jpeg" /></figure><h3>Introduction:</h3><p>Access control is a fundamental aspect of any application, ensuring that users only have access to the resources and functionalities appropriate for their roles and permissions. In the realm of Node.js and TypeScript-based applications, NestJS has emerged as a powerful framework for building scalable and maintainable server-side applications. When it comes to implementing access control in NestJS, two common approaches are Role-Based Access Control (RBAC) and Attribute-Based Access Control with Conditions, Limits, and Separation (CASL). In this article, we’ll delve into both approaches, exploring their concepts, implementations, advantages, and disadvantages.</p><h3>Role-Based Access Control (RBAC):</h3><p>RBAC is a widely adopted access control model that assigns roles to users and permissions to roles. Users inherit permissions based on their assigned roles. In NestJS, RBAC can be implemented using middleware, guards, or interceptors.</p><h3>Advantages of RBAC:</h3><ol><li>Simplicity: RBAC provides a straightforward model where permissions are tied to predefined roles, making it easy to manage access control.</li><li>Scalability: RBAC scales well with the growth of an application since roles can be easily added or modified to accommodate new functionalities.</li><li>Ease of Maintenance: With clearly defined roles and permissions, maintaining and updating access control rules becomes simpler and less error-prone.</li></ol><h3>Disadvantages of RBAC:</h3><ol><li>Rigidity: RBAC might become too rigid for complex access control requirements, especially when there’s a need for fine-grained access control based on various conditions.</li><li>Role Proliferation: As the application grows, the number of roles might proliferate, leading to role explosion and increased complexity in managing permissions.</li><li>Lack of Contextual Control: RBAC often lacks the ability to enforce access control based on contextual attributes other than roles and permissions.</li></ol><h3>Attribute-Based Access Control with Conditions, Limits, and Separation (CASL):</h3><p>CASL is a more flexible and fine-grained access control model that focuses on attributes of resources and conditions under which access is granted. It allows defining access policies based on attributes and relationships between resources.</p><h3>Advantages of CASL:</h3><ol><li>Fine-Grained Control: CASL enables fine-grained access control by allowing permissions to be defined based on various attributes and conditions associated with resources.</li><li>Contextual Access Control: CASL provides the ability to enforce access control based on contextual attributes, such as ownership or relationship between resources.</li><li>Dynamic Authorization: CASL supports dynamic authorization by allowing access policies to be evaluated at runtime based on changing conditions and attributes.</li></ol><h3>Disadvantages of CASL:</h3><ol><li>Complexity: Implementing CASL can be more complex compared to RBAC, especially for applications with simple access control requirements.</li><li>Learning Curve: Developers might require more time and effort to understand and implement CASL effectively, especially if they are accustomed to the traditional RBAC model.</li><li>Performance Overhead: CASL’s dynamic nature might introduce performance overhead, especially when evaluating complex access policies at runtime.</li></ol><h3>Conclusion:</h3><p>Both RBAC and CASL are viable approaches for implementing access control in NestJS applications, each with its own set of advantages and disadvantages. RBAC offers simplicity and scalability but might lack flexibility for complex access control requirements. On the other hand, CASL provides fine-grained control and contextual access control but comes with added complexity and potential performance overhead. The choice between RBAC and CASL depends on the specific needs and complexity of the application’s access control requirements. It’s essential to carefully evaluate these factors and choose the approach that best aligns with the application’s goals and constraints.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1cde782e5c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing a Cricket Dashboard: Building a Scorecard using Input String in JavaScript]]></title>
            <link>https://medium.com/@kathishcivil94/designing-a-cricket-dashboard-building-a-scorecard-using-input-string-in-javascript-d5caa631b3b3?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5caa631b3b3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[cricket]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Wed, 04 Jun 2025 06:44:50 GMT</pubDate>
            <atom:updated>2025-06-04T06:44:50.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-UuLHzZsx-zCJQ6fjJ3YA.jpeg" /></figure><h3>Introduction:</h3><p>In cricket, keeping track of runs, wickets, and other statistics during a match is crucial for both players and spectators. In this article, we’ll explore how to design a cricket dashboard using a simple input string representing runs and events during a match. We’ll implement this using JavaScript, providing a handy tool to visualize match progress and player performances.</p><h3>Implementation:</h3><pre>function calculateScore(input) {<br>  let players = {};<br>  let currentBatsmen = &quot;&quot;;<br>  let currentBowler = &quot;&quot;;<br>  let totalRuns = 0;<br>  let totalOvers = 0;<br>  let totalExtras = 0;<br>  let totalWickets = 0;<br>  let remainingWickets = 10;<br><br>  const oversPerBall = 6;<br>  const wideChar = &quot;W&quot;;<br>  const outChar = &quot;O&quot;;<br>  const dotChar = &quot;.&quot;;<br>  const runChars = [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;6&quot;];<br><br>  for (let i = 0; i &lt; input.length; i++) {<br>    const char = input[i];<br><br>    if (char === wideChar) {<br>      totalExtras++;<br>    } else if (char === outChar) {<br>      totalWickets++;<br>      remainingWickets--;<br>      currentBatsmen = &quot;&quot;;<br>    } else if (char === dotChar) {<br>      // Do nothing for dot ball<br>    } else if (runChars.includes(char)) {<br>      const runs = parseInt(char);<br>      totalRuns += runs;<br>      if (currentBatsmen === &quot;&quot;) {<br>        currentBatsmen = `P${Object.keys(players).length + 1}`;<br>        players[currentBatsmen] = runs;<br>      } else {<br>        players[currentBatsmen] += runs;<br>      }<br><br>      // Check if it&#39;s time to switch the strike<br>      if ((totalRuns + totalExtras) % oversPerBall === 0) {<br>        const temp = currentBatsmen;<br>        currentBatsmen = currentBowler;<br>        currentBowler = temp;<br>      }<br>    }<br>  }<br><br>  totalOvers =<br>    Math.floor((totalRuns + totalExtras) / oversPerBall) +<br>    ((totalRuns + totalExtras) % oversPerBall) / 10;<br><br>  return {<br>    players,<br>    currentBatsmen,<br>    currentBowler,<br>    totalRuns,<br>    totalOvers,<br>    totalExtras,<br>    totalWickets,<br>    remainingWickets,<br>  };<br>}<br><br>// Test cases<br>const testCases = [&quot;...222431666&quot;, &quot;46112W1O166O.21143O&quot;, &quot;WWW...23O11..46&quot;];<br><br>testCases.forEach((testCase, index) =&gt; {<br>  console.log(`Test Case ${index + 1}:`);<br>  const score = calculateScore(testCase);<br>  console.log(&quot;Output:&quot;);<br>  for (const player in score.players) {<br>    console.log(`${player} - ${score.players[player]}(runs)`);<br>  }<br>  console.log(`Strike - ${score.currentBatsmen}`);<br>  console.log(`Non-Strike - ${score.currentBowler}`);<br>  console.log(`Total - ${score.totalRuns}`);<br>  console.log(`Overs - ${score.totalOvers}`);<br>  console.log(`Extra - ${score.totalExtras}`);<br>  console.log(`Wickets - ${score.totalWickets}`);<br>  console.log(`Remaining Wickets - ${score.remainingWickets}`);<br>  console.log(&quot;\n&quot;);<br>});</pre><h3>Explanation:</h3><p>This JavaScript code defines a function calculateScore(input) that takes a string input representing runs and events during a cricket match. It parses the input string to calculate various statistics such as total runs, overs, extras, wickets, and player-wise runs. The function returns an object containing these statistics.</p><h3>Conclusion:</h3><p>By implementing this code, we’ve created a simple yet powerful tool to design a cricket dashboard using an input string in JavaScript. This dashboard provides insights into match progress, player performances, and overall match statistics, enhancing the cricket-watching experience for both players and fans.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5caa631b3b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Two-Factor Authentication with Speakeasy in Node.js]]></title>
            <link>https://medium.com/yavar/implementing-two-factor-authentication-with-speakeasy-in-node-js-16eb1adfc8ad?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/16eb1adfc8ad</guid>
            <category><![CDATA[app-security]]></category>
            <category><![CDATA[speakeasy]]></category>
            <category><![CDATA[2fa-authentication]]></category>
            <category><![CDATA[2fa]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 09:56:57 GMT</pubDate>
            <atom:updated>2024-11-19T09:56:16.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LUAZMPOEJ4PmJzKDmYBmQ.png" /></figure><h3>Introduction:</h3><p>Two-factor authentication (2FA) adds an extra layer of security to user authentication by requiring users to provide a one-time password (OTP) in addition to their regular credentials. Speakeasy is a popular Node.js library for implementing 2FA using time-based one-time passwords (TOTP). In this tutorial, we’ll walk through the process of integrating Speakeasy into a Node.js application to implement 2FA.</p><h3>Step 1: Install Speakeasy</h3><p>Open your terminal and navigate to your Node.js project directory. Install the Speakeasy library using npm:</p><pre>npm install speakeasy</pre><h3>Step 2: Configure Speakeasy</h3><p>In your JavaScript file (e.g., app.js), import the Speakeasy library and define configuration settings for Speakeasy:</p><pre>const speakeasy = require(&#39;speakeasy&#39;);<br><br>const SPEAKEASY_CONFIG = {<br>  secretKeyLength: 20,<br>  digits: 4,<br>  encoding: &#39;base32&#39;,<br>  step: 30, // Time step in seconds<br>};</pre><h3>Step 3: Generate OTP Secret Key</h3><p>Implement a function to generate a unique OTP secret key for a user:</p><pre>function generateOtpSecretKey() {<br>  const secretKey = speakeasy.generateSecret({<br>    length: SPEAKEASY_CONFIG.secretKeyLength,<br>  });<br>  return secretKey.base32;<br>}</pre><h3>Step 4: Generate and Verify OTP</h3><p>Implement functions to generate and verify OTPs using the generated secret key:</p><pre>function generateOtp(secretKey) {<br>  return speakeasy.totp({<br>    secret: secretKey,<br>    encoding: SPEAKEASY_CONFIG.encoding,<br>    digits: SPEAKEASY_CONFIG.digits,<br>    step: SPEAKEASY_CONFIG.step,<br>  });<br>}<br><br>function verifyOtp(secret, token) {<br>  return speakeasy.totp.verify({<br>    secret,<br>    token,<br>    encoding: SPEAKEASY_CONFIG.encoding,<br>    step: SPEAKEASY_CONFIG.step,<br>    digits: SPEAKEASY_CONFIG.digits,<br>  });<br>}</pre><h3>Step 5: Run Your Application</h3><p>Add the following code to generate an OTP secret key, generate an OTP using the secret key, and verify the OTP:</p><pre>const otpSecretKey = generateOtpSecretKey();<br>const otp = generateOtp(otpSecretKey);<br>const isOtpValid = verifyOtp(otpSecretKey, otp);<br><br>console.log(&#39;Is OTP valid?&#39;, isOtpValid);</pre><h3>Step 6: Run the Application</h3><p>In your terminal, navigate to the directory containing your JavaScript file (app.js). Run the following command to execute your Node.js application:</p><pre>node app.js</pre><h3>Conclusion:</h3><p>In this tutorial, we’ve learned how to integrate Speakeasy into a Node.js application to implement two-factor authentication (2FA) using time-based one-time passwords (TOTP). By following the steps outlined in this guide, you can enhance the security of your application by adding an extra layer of protection to user authentication.</p><p>Speakeasy simplifies the implementation of 2FA in Node.js applications, making it an excellent choice for securing your application against unauthorized access.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16eb1adfc8ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/implementing-two-factor-authentication-with-speakeasy-in-node-js-16eb1adfc8ad">Implementing Two-Factor Authentication with Speakeasy in Node.js</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hard Delete vs Soft Delete in SQL]]></title>
            <link>https://medium.com/yavar/hard-delete-vs-soft-delete-in-sql-f5088716a72a?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5088716a72a</guid>
            <category><![CDATA[sql-questions]]></category>
            <category><![CDATA[hard-delete]]></category>
            <category><![CDATA[soft-delete]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-queries]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 06:58:30 GMT</pubDate>
            <atom:updated>2024-11-19T09:51:36.074Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*jm_Cn9idu4X1dhgrrcxr-g.png" /></figure><h4>Introduction:</h4><p>In the realm of database management, the decision between hard delete and soft delete plays a crucial role in data integrity and system performance. Both approaches offer distinct advantages and disadvantages, and understanding their nuances is essential for making informed decisions in database design. This article delves into the concepts of hard delete and soft delete in SQL, providing syntax examples, and discussing their respective pros and cons.</p><h4>Hard Delete:</h4><p>Hard delete, as the name suggests, permanently removes data from the database. When a hard delete operation is executed, the corresponding rows are immediately eliminated from the database tables. This approach alters the database’s state irreversibly, making it challenging to recover the deleted data without resorting to backups or other data restoration mechanisms.</p><h4>Syntax:</h4><p>The syntax for performing a hard delete operation in SQL is straightforward:</p><pre>DELETE FROM table_name<br>WHERE condition;</pre><h4>Example:</h4><p>Consider a scenario where you want to remove a user record from a ‘users’ table:</p><pre>DELETE FROM users<br>WHERE user_id = 1;</pre><h4>Advantages of Hard Delete:</h4><ul><li><strong>Efficient use of storage: </strong>Hard delete permanently frees up storage space by eliminating unnecessary data.</li><li><strong>Simplified data management:</strong> Since deleted records are completely removed from the database, there’s no need to manage additional flags or status indicators.</li><li><strong>Enhanced performance:</strong> Hard delete operations are typically faster than soft delete, as they directly remove data without additional processing.</li></ul><h4>Disadvantages of Hard Delete:</h4><ul><li><strong>Irreversible data loss:</strong> Once data is hard deleted, it cannot be recovered without resorting to backups, which may lead to data loss in case of accidental deletions.</li><li><strong>Compliance and audit challenges:</strong> Hard delete can pose challenges in meeting compliance requirements and auditing, as there’s no trace of the deleted data within the system.</li></ul><h4>Soft Delete:</h4><p>Soft delete involves marking data as inactive or deleted without physically removing it from the database. Instead of permanently eliminating rows, a soft delete operation updates a designated column to indicate the deletion status. This approach allows for easy recovery of deleted data and maintains a historical record of changes within the database.</p><h4>Syntax:</h4><p>The syntax for performing a soft delete operation in SQL typically involves updating a column to denote the deletion status:</p><pre>UPDATE table_name<br>SET deleted_at = now()<br>WHERE condition;</pre><h4>Example:</h4><p>Suppose you want to soft delete a record by updating the ‘deleted’ column in the ‘users’ table:</p><pre>UPDATE users<br>SET deleted_at = now()<br>WHERE user_id = 1;</pre><h4>Advantages of Soft Delete:</h4><ul><li><strong>Data recovery:</strong> Soft delete allows for easy recovery of deleted data by updating the deletion status, providing a safety net against accidental data loss.</li><li><strong>Auditing and compliance:</strong> Soft delete maintains a historical record of data changes, facilitating auditing and compliance with regulatory requirements.</li><li><strong>Data integrity: </strong>Soft delete preserves referential integrity within the database, as related records can still reference the deleted data.</li></ul><h4>Disadvantages of Soft Delete:</h4><ul><li><strong>Increased storage overhead:</strong> Soft delete consumes additional storage space, as deleted records remain in the database albeit marked as inactive.</li><li><strong>Performance implications:</strong> Soft delete operations may impact database performance, particularly in scenarios with large volumes of deleted data, as queries need to account for the deletion status.</li></ul><h4>Conclusion:</h4><p>In conclusion, the choice between hard delete and soft delete in SQL depends on the needs of your application and regulatory requirements. Hard delete offers efficiency and simplicity by permanently removing data, while soft delete provides data recovery and auditability. By understanding the advantages and disadvantages of each approach, database administrators can make informed decisions to maintain data integrity and optimize system performance.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5088716a72a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/hard-delete-vs-soft-delete-in-sql-f5088716a72a">Hard Delete vs Soft Delete in SQL</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Tasks in NestJS with Cron Jobs]]></title>
            <link>https://medium.com/yavar/automating-tasks-in-nestjs-with-cron-jobs-d5fa837f9565?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fa837f9565</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[cronjob]]></category>
            <category><![CDATA[nestjs-tutorial]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cronjob-scheduler]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Sat, 11 May 2024 14:37:35 GMT</pubDate>
            <atom:updated>2024-06-03T12:42:28.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*Rg504a53y7aGHN6XFGI5hQ.jpeg" /></figure><h4>Introduction:</h4><p>In modern web applications, automating repetitive tasks is essential for improving efficiency and maintaining system health. Cron jobs provide a convenient way to schedule and execute tasks at specific intervals. In this guide, we’ll explore how to implement cron jobs in NestJS, a powerful framework for building server-side applications with Node.js. We’ll cover the fundamentals of cron jobs, their implementation in NestJS, and provide practical examples to demonstrate their usage.</p><h4>Step 1: Setting Up a NestJS Project</h4><p>First, ensure you have Node.js and npm installed on your system. You can install NestJS CLI globally using npm:</p><pre>npm install -g @nestjs/cli</pre><p>Create a new NestJS project using the CLI:</p><pre>nest new nest-cron-job</pre><p>Navigate to the project directory:</p><pre>cd nest-cron-job</pre><h4>Step 2: Installing Dependencies</h4><p>NestJS provides built-in support for cron jobs through the @nestjs/schedule package. Install it along with its peer dependencies:</p><pre>npm install --save @nestjs/schedule rxjs</pre><p>Note: The rxjs package is installed as a peer dependency along with @nestjs/schedule. This is because @nestjs/schedule internally uses RxJS observables for managing cron jobs and scheduling tasks asynchronously.</p><h4>Step 3: Implementing a Cron Job</h4><p>Create a new service to handle the cron job. For example, let’s create a task.service.ts file in the src directory:</p><pre>// src/task.service.ts<br><br>import { Injectable, Logger } from &#39;@nestjs/common&#39;;<br>import { Cron } from &#39;@nestjs/schedule&#39;;<br><br>@Injectable()<br>export class TaskService {<br>  private readonly logger = new Logger(TaskService.name);<br><br>  @Cron(&#39;0 * * * * *&#39;)<br>  handleCron() {<br>    this.logger.debug(&#39;Called every minute&#39;);<br>  }<br>}</pre><p>In this example, the handleCron() method will be executed every minute according to the cron expression &#39;0 * * * * *&#39;.</p><h4>Step 4: Registering the Cron Job Provider</h4><p>Register the TaskService provider in your module. Open the app.module.ts file and import the ScheduleModule:</p><pre>// src/app.module.ts<br><br>import { Module } from &#39;@nestjs/common&#39;;<br>import { ScheduleModule } from &#39;@nestjs/schedule&#39;;<br>import { TaskService } from &#39;./task.service&#39;;<br><br>@Module({<br>  imports: [ScheduleModule.forRoot()],<br>  providers: [TaskService],<br>})<br>export class AppModule {}</pre><h4>Step 5: Testing the Cron Job</h4><p>You can now run your NestJS application and observe the cron job in action. Start the application using the following command:</p><pre>npm run start</pre><p>You should see the log message &#39;Called every minute&#39; being printed to the console every minute, indicating that the cron job is running successfully.</p><h4>Practical Examples</h4><p>Consider some practical examples of cron jobs in NestJS:</p><ol><li>Sending daily email reminders to users.</li><li>Cleaning up expired session data from the database.</li><li>Generating weekly reports and storing them in a designated folder.</li></ol><h4>Conclusion:</h4><p>By following the steps outlined in this guide, you’ve learned how to implement cron jobs in NestJS to automate tasks at specific intervals. Whether it’s performing routine maintenance, generating reports, or sending notifications, cron jobs streamline operations and enhance the efficiency of your NestJS applications. Experiment with different cron expressions and task implementations to tailor cron jobs to your specific use case.</p><p>Now you’re equipped with the knowledge to incorporate cron jobs into your NestJS projects and automate tasks effectively.</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fa837f9565" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/automating-tasks-in-nestjs-with-cron-jobs-d5fa837f9565">Automating Tasks in NestJS with Cron Jobs</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sending Emails in Node.js with Nodemailer]]></title>
            <link>https://medium.com/yavar/sending-emails-in-node-js-with-nodemailer-36c6e32dc37e?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/36c6e32dc37e</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodemailer]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[node-js-development]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 04:51:38 GMT</pubDate>
            <atom:updated>2024-03-05T04:51:38.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m14OE-AL4PHv9UJS1tKAxg.png" /></figure><p>Hai Friends, In this post we are going to learn about how to send emails in Node.js with Nodemailer.</p><h3>Introduction</h3><p>In the world of web development, sending emails is a crucial functionality for various applications, like user confirmations, notifications, and feedback forms. In Node.js, this task is efficiently accomplished using the popular library called <strong>Nodemailer</strong>. This blog post will guide you through the process of sending emails using Nodemailer, from installation to crafting detailed messages.</p><p><strong>Step 1: Setting Up</strong></p><p>Before diving into the code, ensure you have Node.js and npm (or yarn) installed on your system. You can verify this by running node -v and npm -v in your terminal.</p><p><strong>Step 2: Project Setup</strong></p><p>Create a new directory for your project and navigate to it using your terminal. Then, initialize a new npm project by running:</p><pre>npm init -y</pre><p>This creates a package.json file, which will manage your project&#39;s dependencies.</p><p><strong>Step 3: Install Nodemailer</strong></p><p>Now, use npm to install the Nodemailer library:</p><pre>npm install nodemailer --save</pre><p>This command installs Nodemailer and adds it to your project’s dependencies in the package.json file.</p><p><strong>Step 4: Create a Node.js Script</strong></p><p>Create a new JavaScript file (e.g., send_email.js) to write your Nodemailer code. Open this file in your preferred code editor.</p><p><strong>Step 5: Configure Nodemailer</strong></p><p>Within your send_email.js file, import the Nodemailer library:</p><pre>const nodemailer = require(&#39;nodemailer&#39;);</pre><p>Next, create a transporter object to specify the email sending configuration. Here’s an example using SMTP (Simple Mail Transfer Protocol), the most common email sending protocol:</p><pre>const transporter = nodemailer.createTransport({<br>  host: &#39;smtp.your_email_provider.com&#39;, // Replace with your provider&#39;s SMTP server<br>  port: 587, // Port may vary depending on your provider<br>  secure: false, // Use true for TLS, false for non-TLS (consult your provider)<br>  auth: {<br>    user: &#39;your_email@provider.com&#39;, // Replace with your email address<br>    pass: &#39;your_password&#39; // Replace with your email password<br>  }<br>});</pre><p><strong>Important considerations:</strong></p><p><strong>Replace placeholders:</strong></p><ul><li>your_email_provider.com: Replace with the SMTP server address of your email provider (e.g., smtp.gmail.com, smtp.yahoo.com).</li><li>your_email@provider.com: Replace with your email address that will be used to send the email.</li><li>your_password: <strong>Do not</strong> store your email password directly in the code. Consider environment variables or a secure configuration file to manage sensitive information.</li></ul><p><strong>Consult your email provider:</strong> Refer to your email provider’s documentation for specific SMTP server details and security requirements. Some providers may require additional authentication steps.</p><p><strong>Step 6: Craft the Email Message</strong></p><p>Define an object (mailOptions) containing details about the email:</p><pre>const mailOptions = {<br>  from: &#39;your_email@provider.com&#39;, // Replace with your email address<br>  to: &#39;recipient@example.com&#39;, // Replace with the recipient&#39;s email address<br>  subject: &#39;Sending Email using Nodemailer&#39;, // Replace with your desired subject<br>  text: &#39;This is a plain text email body.&#39;, // Plain text content<br>  // or<br>  html: &#39;&lt;h1&gt;Welcome!&lt;/h1&gt;&lt;p&gt;This is an HTML email body.&lt;/p&gt;&#39; // HTML content (optional)<br>};</pre><ul><li><strong>Plain text vs. HTML:</strong> Choose either text or html for the email body. You can include both in the same message, but only the first one will be displayed by the email client.</li><li><strong>Customize the message:</strong> Replace the placeholder values with your desired content.</li></ul><p><strong>Step 7: Send the Email</strong></p><p>Finally, use the sendMail method of the transporter object to send the email:</p><pre>transporter.sendMail(mailOptions, (error, info) =&gt; {<br>  if (error) {<br>    console.error(error);<br>  } else {<br>    console.log(&#39;Email sent: &#39; + info.response);<br>  }<br>});</pre><ul><li><strong>Error handling:</strong> The sendMail method is asynchronous, meaning it returns immediately and executes the provided callback function when the email sending process is complete.</li><li>The first argument to the callback function is an error object, which will be null if the email is sent successfully.</li><li>The second argument is an info object containing details about the sent email, such as its message ID.</li></ul><p><strong>Step 8: Run the Script</strong></p><p>Open your terminal, navigate to the directory containing your send_email.js file, and execute it using Node.js:</p><pre>node send_email.js</pre><p><strong>Conclusion:</strong></p><p>In this Post, we have learned about how to send emails in Node.js with Nodemailer. Hope to see you all in my next post, Until then Take Care! Keep Learning!</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36c6e32dc37e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/sending-emails-in-node-js-with-nodemailer-36c6e32dc37e">Sending Emails in Node.js with Nodemailer</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FastAPI Introduction]]></title>
            <link>https://medium.com/yavar/fastapi-introduction-7100e5da70ad?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7100e5da70ad</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-backend]]></category>
            <category><![CDATA[fastapi-tutorials]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[fastapi]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 09:44:56 GMT</pubDate>
            <atom:updated>2023-08-16T06:46:50.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UNgF3LO1GFmTBRfWT_EXsw.png" /></figure><p>Welcome to the exciting world of FastAPI — the high-speed Python web framework!. In this post we are going to learn about FastAPI Introduction.</p><p>FastAPI is known for its exceptional performance, easy-to-use API, and support for asynchronous programming. If you’re looking for a fast and modern solution to build web APIs and applications with Python, FastAPI is the perfect choice.</p><h4>FastAPI:</h4><ul><li>FastAPI is a modern fast(high-performance) web framework for building API’s.</li><li>FastAPI is based on Pydantic and uses type hints to validate, serialize and deserialize data.</li><li>FastAPI fully support asynchronous programming and can run on Gunicorn and ASGI(<strong>Asynchronous Server Gateway Interface</strong>) servers such as Uvicorn and Hypercorn.</li></ul><h4>Key Features:</h4><ul><li>Is an excellent choice for building high-performance API’s.</li><li><strong>Fast to Code:</strong> Increase the speed to develop features by about 200% to 300%.</li><li><strong>Fewer Bugs:</strong> Reduce about 40% of human(developer) induced errors.</li><li><strong>Easy and Short: </strong>Design to be easy to use and learn.Less time reading docs. Minimize code duplication. Multiple features from each parameter declaration.</li></ul><h4>Pros of FastAPI:</h4><p><strong>Excellent Performance:</strong></p><ul><li>If we were to name one quality by which FastAPI beats Flask, its a performance.</li><li>FastAPI is actually known as one of the fastest python web frameworks. In fact, only starlette and uvicorn, on which FastAPI is built, are faster.</li><li>This superior performance is enabled precisely by ASGI, thanks to which FastAPI supports concurrency and asynchronous code.</li><li>This is achieved by declaring the endpoints with async def syntax.</li></ul><p><strong>Concurrency:</strong></p><ul><li>Concurrency is when two or more tasks can start, run and complete in overlapping time period.</li><li>It doesn’t necessarily mean they will be running at the same instant, such as multitasking on a single-core machine.</li></ul><p><strong>Dependency injection support:</strong></p><ul><li>FastAPI offers a simple and easy-to-use dependency injection system. Dependency system, a compositional way of declaring the necessary components required for the code to run properly.</li><li>FastAPI, developers can simply declare relevant dependencies in the path operation functions assigned to the API endpoints.</li></ul><p><strong>Inbuilt documentation support:</strong></p><ul><li>FastAPI offers an extremely handy automatic documentation system. It provides a browser-based user interface that interactively documents an API, powered by Swagger UI GUI.</li></ul><p><strong>Inbuilt data validation:</strong></p><ul><li>This is an enormous benefit-inbuilt data validation allows developers to create compact code through skipping the validation. It can detect invalid datatypes during the run and returns the reason for bad input in JSON format.</li></ul><h4>Cons of FastAPI:</h4><p><strong>Lack of inbuilt security system:</strong></p><ul><li>FastAPI doesn’t offer a built-in security system. Instead it provides a fastapi.security module for security mechanisms. At the same time, it doesn’t support OAuth2.0</li></ul><p><strong>Small community for developers:</strong></p><ul><li>FastAPI is relatively new(8 years younger than Flask) , which means its community is still rather small and their educational materials available for this framework is still limited</li><li>Upon searching, you will find that only a few books, guides, or tutorials are available. At the same time, it is growing in popularity, so this may change in the coming years.</li></ul><h4>Which Projects use FastAPI:</h4><ul><li>Machine learning projects</li><li>Data science projects</li><li>Deep learning projects</li><li>Big data projects</li><li>NLP projects</li><li>IoT projects</li><li>Neutral network projects</li><li>Tensorflow projects</li></ul><h3>Conclusion</h3><p>In this Post, we have learned about the basic introduction in FastAPI python. Hope to see you all in my next post, Until then Take Care! Keep Learning!</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7100e5da70ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/fastapi-introduction-7100e5da70ad">FastAPI Introduction</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSI Model]]></title>
            <link>https://medium.com/yavar/osi-model-93e1e4e6fafd?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/93e1e4e6fafd</guid>
            <category><![CDATA[osi-layer]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[osimodel-computernetwork]]></category>
            <category><![CDATA[layers-of-osi-model]]></category>
            <category><![CDATA[osi-model]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Thu, 13 Apr 2023 10:50:07 GMT</pubDate>
            <atom:updated>2023-04-17T00:50:39.095Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*QgyDWZRA-eY7bo04M6E_hw.png" /></figure><p>Hai Friends, In this post we are going to learn about OSI Model concept in computer networking.</p><h4>OSI Model:</h4><ul><li>Open Systems Interconnection Model</li><li>Developed by International Organization of Standards (ISO)</li><li>To achieve the International Standards in communication</li><li>It is a conceptual model that characterizes and standardizes the communication function of a telecommunication or computing system without regard to their underlying internal structure and technology</li><li>In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: <strong>Physical, Data Link, Network, Transport, Session, Presentation, and Application</strong>.</li></ul><h4><strong>Application Layer:</strong></h4><ul><li>It is the topmost layer</li><li>Transferring of files disturbing the results of the user is also done in this layer. Mail service, Directory services, network resource etc. are services provided by application layer</li><li>This layer mainly holds application programs to act upon the received and to be sent data.</li><li>Protocols are HTTP, FTP, DNS, SMTP, SNMP, TELNET</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*TRHEpq0JyQTsj766_F83Yw.png" /></figure><h4><strong>Presentation Layer:</strong></h4><ul><li>The presentation layer takes care that the data is sent in such a way that the receiver will understand the information(data) and will be able to use the data.</li><li>While receiving the data, presentation layer transforms the data to be ready for the application layer</li><li>Languages (syntax) can be different of the two communicating systems. Under this condition presentation layer plays a role of translator</li><li>It performs Data Compression, Data encryption, Data conversion etc.</li><li>Protocols are MIME, XDR, SSL</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*X6NIw5UzaWOOHdV0pA5dOQ.png" /></figure><h4><strong>Session Layer:</strong></h4><ul><li>Session layer manages and synchronize the conversation between two different applications</li><li>Transfer of data from source to destination session layer streams of data are marked and are resynchronized properly, so that the ends of the messages are not cut prematurely, and data loss is avoided</li><li>Protocols are PPTP, SIP, SAP, NetBIOS</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*9_0Zt1X3GrJ197f4smVTdA.png" /></figure><h4><strong>Transport Layer:</strong></h4><ul><li>It decides weather data transmission should be on parallel path or single path</li><li>Functions such as Multiplexing, segmenting or splitting on the data are done by this layer</li><li>It receives messages from the session layer above it, convert the message into smaller units and passes it on to the network layer</li><li>Transport layer can be very complex, depending upon the network requirements</li><li>Protocols are TCP, UDP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*x_99nR9qBVVno3JBqTmeiQ.png" /></figure><h4><strong>Network Layer:</strong></h4><ul><li>It divides the outgoing messages into packets and assembles the incoming packets into messages for higher levels</li><li>It routes the packets through different channels from one node to other</li><li>It acts as a network controller. It manages the subnet traffic</li><li>It decides by which route the data packet should take</li><li>Protocols are IPv4, IPv6, ICMP, IPSec, IPX, Apple Talk</li><li>Device use is router</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*r0m9-nO0Jf1PgSHTnGEI6Q.png" /></figure><h4><strong>Data link layer:</strong></h4><ul><li>The main function of this layer is to make sure data transfer is error free from one node to another, over the physical layer</li><li>Transmitting and receiving data frames sequentially is managed by this layer</li><li>This layer sends and expects acknowledgments for frames received and sent respectively, resending of non-acknowledgment received frames is also handled by this layer.</li><li>This layer establishes a logical layer between two nodes, and also manages the frame traffic control over the network. It signals the transmitting node to stop, when the frame buffers are full</li><li>Protocols are ATM, Frame relay, ARP, PPP etc.,</li><li>Devices are Switch and Bridge</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*0Ko1-NGgk4uaj1hodSdXfQ.png" /></figure><h4><strong>Physical Layer:</strong></h4><ul><li>It is the lowest layer of the OSI model</li><li>It activates, maintains and deactivates the physical connection</li><li>It is responsible of transmission and reception of the unstructured raw data over network</li><li>Devices are hubs, cables, RJ45, RJ11 etc.</li><li>It converts the digital/analog bits into electrical signals or optical signals</li><li>Data encoding is also done in this layer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*W_K4GIcHYuu9SfQhRsSv0Q.png" /></figure><h4>OSI 7 Layers:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*P309NyiZBFkRTtwPkIewmw.png" /></figure><h3>Conclusion</h3><p>In this Post, we have learned about OSI Model in computer networking. Hope to see you all in my next post, Until then Take Care! Keep Learning!</p><h3>Thank You For Reading this Post………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93e1e4e6fafd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/osi-model-93e1e4e6fafd">OSI Model</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL JOINS]]></title>
            <link>https://medium.com/yavar/sql-joins-69556a5f92f6?source=rss-74ab173af0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/69556a5f92f6</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[sql-joins]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgresql-joins]]></category>
            <category><![CDATA[database-relationships]]></category>
            <dc:creator><![CDATA[KATHISH KUMARAN R ]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 12:44:30 GMT</pubDate>
            <atom:updated>2023-02-02T07:40:44.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*Ojil1CLS8BhSD51C_yccDQ.png" /></figure><p>Hi Friends, In this blog we are going to learn about SQL JOINS.</p><h4>SQL:</h4><ul><li>Structured Query Language</li><li>SQL is a database computer language designed for the retrieval and management of data in a relational database.</li><li>SQL is used <strong>to communicate with a database</strong></li></ul><h4>SQL Joins:</h4><ul><li>Joins in SQL are commands which are used to combine rows from two or more tables based on a related column between those tables.</li><li>They are predominantly used when the user is trying to extract data from the tables which have one-to-many or many-to-many relationship between them.</li></ul><h4>Types Of Joins:</h4><ul><li>Inner Join</li><li>Left Join</li><li>Right Join</li><li>Full Join</li></ul><p>Consider these three below tables for Examples:</p><p><strong>Employee Table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*9VZ4ueJh2UVzFW5bnErCug.png" /></figure><p><strong>Project Table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*Jy0dPxdZR9KNwdx0fY5PUQ.png" /></figure><p><strong>Client Table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*qqEDE2YPGXlTliGMFLeRMQ.png" /></figure><h4>INNER JOIN:</h4><ul><li>This type of join returns those records which have matching values in both tables.</li><li>So, if you perform an INNER join operation between the Employee table and the Projects table, all the tuples which have matching values in both the tables will be given as output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/159/1*dK_janA2i8i9tx8J_otJYw.png" /></figure><p><strong>Syntax:</strong></p><pre>SELECT Table1.Column1,Table1.Column2,Table2.Column1,....<br>FROM Table1<br>INNER JOIN Table2<br>ON Table1.MatchingColumnName = Table2.MatchingColumnName;</pre><p><strong>Example:</strong></p><pre>SELECT Employee.EmpID, Employee.EmpFname, Employee.EmpLname, Projects.ProjectID, Projects.ProjectName<br>FROM Employee<br>INNER JOIN Projects ON Employee.EmpID=Projects.EmpID;</pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*3iwmoYq_3j0ttEkfmz6ecA.png" /></figure><pre>Note: We can also write JOIN instead of INNER JOIN. JOIN is same as INNER JOIN. </pre><h4>LEFT JOIN:</h4><ul><li>This join returns all the rows of the table on the left side of the join and matches rows for the table on the right side of the join.</li><li>For the rows for which there is no matching row on the right side, the result-set will contain <em>null</em>. LEFT JOIN is also known as LEFT OUTER JOIN.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*1NpP7knK5soyxDtgw0eBdQ.png" /></figure><p><strong>Syntax:</strong></p><pre>SELECT Table1.Column1,Table1.Column2,Table2.Column1,....<br>FROM Table1<br>LEFT JOIN Table2<br>ON Table1.MatchingColumnName = Table2.MatchingColumnName;</pre><p><strong>Example:</strong></p><pre>SELECT Employee.EmpFname, Employee.EmpLname, Projects.ProjectID, Projects.ProjectName<br>FROM Employee<br>LEFT JOIN<br>ON Employee.EmpID = Projects.EmpID ;</pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*a47MlBZJQTB8gbTZ-KK7lg.png" /></figure><pre>Note: We can also use LEFT OUTER JOIN instead of LEFT JOIN, both are the same.</pre><h4>RIGHT JOIN:</h4><ul><li>RIGHT JOIN is similar to LEFT JOIN. This join returns all the rows of the table on the right side of the join and matching rows for the table on the left side of the join.</li><li>For the rows for which there is no matching row on the left side, the result-set will contain <em>null</em>. RIGHT JOIN is also known as RIGHT OUTER JOIN.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/1*VjTmRHhanXD0z7aWovU8VQ.png" /></figure><p><strong>Syntax:</strong></p><pre>SELECT Table1.Column1,Table1.Column2,Table2.Column1,....<br>FROM Table1<br>RIGHT JOIN Table2<br>ON Table1.MatchingColumnName = Table2.MatchingColumnName;</pre><p><strong>Example:</strong></p><pre>SELECT Employee.EmpFname, Employee.EmpLname, Projects.ProjectID, Projects.ProjectName<br>FROM Employee<br>RIGHT JOIN<br>ON Employee.EmpID = Projects.EmpID;</pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*MpvB7zBPYCOsVT80mK7xrA.png" /></figure><pre>Note: We can also use RIGHT OUTER JOIN instead of RIGHT JOIN, both are the same. </pre><h4>FULL JOIN:</h4><ul><li>FULL JOIN creates the result-set by combining results of both LEFT JOIN and RIGHT JOIN. The result-set will contain all the rows from both tables.</li><li>For the rows for which there is no matching, the result-set will contain <em>NULL</em> values.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/167/1*8QK3fS4H4fnxzQCXpq6_9g.png" /></figure><p><strong>Syntax:</strong></p><pre>SELECT Table1.Column1,Table1.Column2,Table2.Column1,....<br>FROM Table1<br>FULL JOIN Table2<br>ON Table1.MatchingColumnName = Table2.MatchingColumnName;</pre><p><strong>Example:</strong></p><pre>SELECT Employee.EmpFname, Employee.EmpLname, Projects.ProjectID<br>FROM Employee<br>FULL JOIN Projects<br>ON Employee.EmpID = Projects.EmpID;</pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*8vGjeaNLbDK3DlYvtcGQcQ.png" /></figure><h4>Hash Joins:</h4><p>Hash Joins are also the type of joins which are used to join large tables or in an instance, where the user wants most of the joined table rows.</p><p>The Hash Join algorithm is a two-step algorithm:</p><ol><li>Build Phase</li><li>Probe Phase</li></ol><h4>Self Join:</h4><p>Self Join is a join of a table to itself. This implies that each row in a table is joined with itself</p><h4>Cross Join:</h4><p>Cross Join is a type of join in which a join clause is applied to each row of a table to every row of the other table. Also, when WHERE condition is used, this type of join behaves as a INNER JOIN, and when WHERE condition is not present, it behaves like a CARTESIAN product.</p><p><strong>Syntax:</strong></p><pre>SELECT ... FROM table1 CROSS JOIN table2 ...</pre><h3>Conclusion</h3><p>In this Blog, we have learned about SQL JOINS. Hope to see you all in my next blog post, Until then Take Care! Keep Learning!</p><h3>Thank You For Reading this Blog………</h3><p><strong>Have a Nice Day……</strong></p><p>👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69556a5f92f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yavar/sql-joins-69556a5f92f6">SQL JOINS</a> was originally published in <a href="https://medium.com/yavar">YavarTechWorks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>