<?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 Dikshith B V on Medium]]></title>
        <description><![CDATA[Stories by Dikshith B V on Medium]]></description>
        <link>https://medium.com/@dikshith2000bv?source=rss-e6959eb77374------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*f2ORbMF82eupNDkq</url>
            <title>Stories by Dikshith B V on Medium</title>
            <link>https://medium.com/@dikshith2000bv?source=rss-e6959eb77374------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:42:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dikshith2000bv/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[NGINX]]></title>
            <link>https://medium.com/@dikshith2000bv/nginx-15897dc60301?source=rss-e6959eb77374------2</link>
            <guid isPermaLink="false">https://medium.com/p/15897dc60301</guid>
            <dc:creator><![CDATA[Dikshith B V]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 14:44:09 GMT</pubDate>
            <atom:updated>2025-04-15T14:58:11.424Z</atom:updated>
            <content:encoded><![CDATA[<h3>NGINX : Master the Power of NGINX: From Setting Up Your First Server to Advanced Load Balancing, Security, and Optimization.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1HibAsZoeoRKr6YIpBQrw.png" /></figure><p>NGINX has become popular in modern web infrastructure. Renowned for its high performance, scalability, and low resource usage, <strong>NGINX serves as a web server, reverse proxy, </strong>and<strong> load balancer</strong>. Initially released in <strong>2004</strong>, NGINX now powers a significant portion of the internet, outperforming traditional web servers like Apache in key metrics.</p><p>Whether you’re a developer or a system administrator, mastering NGINX is essential to building robust and efficient web applications.</p><h3>Understanding NGINX: The Foundation</h3><p><strong>NGINX is an open-source software</strong> that stands out due to its event-driven, asynchronous architecture. This design allows it to handle thousands of connections simultaneously, making it ideal for handling high traffic with minimal hardware resources.</p><p>Key Features:</p><ul><li><strong>Web Server</strong>: Serves static and dynamic content efficiently.</li><li><strong>Reverse Proxy</strong>: Protects and optimizes backend servers.</li><li><strong>Load Balancer</strong>: Distributes traffic intelligently across multiple servers.</li><li><strong>HTTP Caching</strong>: Speeds up content delivery.</li></ul><p>Its versatility, combined with a straightforward configuration system, makes NGINX a favorite among DevOps professionals.</p><h3>Getting Started with NGINX</h3><h3>Installation</h3><p>To begin, you’ll need to install NGINX on your system. Here’s how to do it on popular platforms:</p><p><strong>For Ubuntu/Debian:</strong></p><pre>sudo apt update  <br>sudo apt install nginx</pre><p><strong>For CentOS/RHEL:</strong></p><pre>sudo yum install epel-release  <br>sudo yum install nginx</pre><p><strong>For Windows:</strong><br>Download the pre-compiled binaries from the <a href="https://nginx.org/">official NGINX website</a>.</p><h3>Basic Commands</h3><p>Once installed, control NGINX with these essential commands:</p><ul><li>Start: sudo systemctl start nginx</li><li>Stop: sudo systemctl stop nginx</li><li>Restart: sudo systemctl restart nginx</li><li>Check Status: sudo systemctl status nginx</li></ul><h3>Configuring Your First NGINX Server</h3><p>To serve your first static website, follow these steps:</p><ul><li><strong>Create the Directory Structure</strong>:</li></ul><pre>sudo mkdir -p /var/www/demo.com/html  <br>sudo chmod -R 755 /var/www/demo.com</pre><ul><li><strong>Add a Simple HTML Page:</strong></li></ul><pre>echo &quot;&lt;h1&gt;Welcome to NGINX&lt;/h1&gt;&quot; | sudo tee /var/www/demo.com/html/index.html</pre><ul><li><strong>Update the Configuration File</strong>:<br>Edit /etc/nginx/sites-available/demo.com:</li></ul><pre>server {  <br>    listen 80;  <br>    server_name example.com www.example.com;  <br>    root /var/www/example.com/html;  <br>    index index.html;  <br>}</pre><ul><li><strong>Enable the Site and Reload NGINX</strong>:</li></ul><pre>sudo ln -s /etc/nginx/sites-available/demo.com /etc/nginx/sites-enabled/  <br>sudo nginx -t  <br>sudo systemctl reload nginx</pre><p>Visit http://your-server-ip/ in a browser to see your website live!</p><h3>Diving Deeper: Reverse Proxy and Load Balancing</h3><h3>Configuring a Reverse Proxy</h3><p>A reverse proxy forwards client requests to backend servers. Add this configuration to your server block:</p><pre>location / {  <br>    proxy_pass http://127.0.0.1:8080;  <br>    proxy_set_header Host $host;  <br>    proxy_set_header X-Real-IP $remote_addr;  <br>}</pre><h3>Load Balancing Configuration</h3><p>Distribute traffic across servers using this example:</p><pre>upstream backend {  <br>    server server1.demo.com;  <br>    server server2.demo.com;  <br>}  <br>  <br>server {  <br>    listen 80;  <br>    location / {  <br>        proxy_pass http://backend;  <br>    }  <br>}</pre><p>You can switch between load balancing methods such as round-robin, least connections, and IP hash by updating the upstream block.</p><h3>Advanced Mastery: Security and Optimization</h3><h3>Enabling HTTPS</h3><p>Secure your site with Let’s Encrypt:</p><pre>sudo apt install certbot python3-certbot-nginx  <br>sudo certbot --nginx -d demo.com -d www.demo.com</pre><h3>Rate Limiting</h3><p>Prevent DDoS attacks with rate limiting:</p><pre>http {  <br>    limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;  <br>  <br>    server {  <br>        location / {  <br>            limit_req zone=one;  <br>        }  <br>    }  <br>}</pre><h3>Caching for Performance</h3><p>Enable caching to speed up your site:</p><pre>location / {  <br>    proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m;  <br>    proxy_cache my_cache;  <br>    proxy_pass http://backend;  <br>}</pre><h3>Troubleshooting and Debugging NGINX</h3><p>If issues arise, start with these common tools:</p><h3>Logs</h3><ul><li>Access logs: /var/log/nginx/access.log</li><li>Error logs: /var/log/nginx/error.log</li></ul><h3>Test Configurations</h3><pre>sudo nginx -t</pre><h3>Debug with Curl</h3><pre>curl -I http://your-server-ip/</pre><h3>Conclusion: Becoming an NGINX Expert</h3><p>From installation to advanced configurations, this guide equips you with the foundational and advanced knowledge needed to master NGINX. To deepen your expertise, explore the <a href="https://nginx.org/">official documentation</a>, experiment with real-world scenarios, and engage with the thriving NGINX community.</p><p>Master NGINX today, and unlock the power of high-performance web servers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15897dc60301" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing Docker and Kubernetes: Benefits, Challenges, and Key Differences]]></title>
            <link>https://medium.com/@dikshith2000bv/comparing-docker-and-kubernetes-benefits-challenges-and-key-differences-e5786d7213b6?source=rss-e6959eb77374------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5786d7213b6</guid>
            <dc:creator><![CDATA[Dikshith B V]]></dc:creator>
            <pubDate>Thu, 20 Feb 2025 10:18:14 GMT</pubDate>
            <atom:updated>2025-02-20T10:18:14.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*TERKhlTKAOkYlFvZk_u4kA.png" /></figure><h3>Introduction</h3><p><strong>Docker</strong> and <strong>Kubernetes</strong> are both widely used in the field of containerization, which allows for the efficient packaging, deployment, and management of applications. Though they are closely related, they serve different purposes.</p><ul><li><strong>Docker</strong> is a platform and tool for developing, packaging, and running applications inside containers. It provides an isolated environment for running software with all its dependencies bundled together.</li><li><strong>Kubernetes</strong> is a container orchestration platform used to automate the deployment, scaling, and management of containerized applications. It can manage clusters of containers (often Docker containers) running across multiple machines.</li></ul><h3>Advantages</h3><h4>Docker:</h4><ol><li><strong>Portability</strong>: Docker containers can run anywhere, whether it’s on a developer’s laptop, a testing server, or in the cloud. Since the container includes the app and all its dependencies, it ensures that the app runs the same way across environments.</li><li><strong>Efficiency</strong>: Containers are lightweight because they share the host system’s OS kernel. This allows for running many containers on a single machine, utilizing resources effectively.</li><li><strong>Simplified Development</strong>: Docker simplifies the development process by providing a consistent environment that minimizes “it works on my machine” issues.</li><li><strong>Fast Setup</strong>: Docker containers can be spun up quickly, reducing development and testing time.</li><li><strong>Isolation</strong>: Containers provide application isolation, ensuring that different apps running on the same machine do not interfere with each other.</li></ol><h4>Kubernetes:</h4><ol><li><strong>Automated Scaling</strong>: Kubernetes automatically scales applications up or down based on demand (e.g., adding more instances of a container during peak traffic).</li><li><strong>Self-healing</strong>: Kubernetes can detect when a container or pod fails and automatically restarts or replaces it.</li><li><strong>Load Balancing</strong>: It provides efficient load balancing to ensure that no container is overwhelmed with traffic.</li><li><strong>High Availability</strong>: Kubernetes ensures that applications are highly available by distributing containers across nodes and ensuring that the application is always running.</li><li><strong>Service Discovery</strong>: Kubernetes can automatically manage the discovery and communication between different services (e.g., microservices) in your application.</li></ol><h3>Challenges</h3><h4>Docker:</h4><ol><li><strong>Security</strong>: Containers share the host OS kernel, which can present security risks if not properly managed (e.g., privilege escalation).</li><li><strong>Persistence</strong>: By default, Docker containers are ephemeral. Managing persistent data across container restarts requires additional tools like Docker Volumes.</li><li><strong>Networking Complexity</strong>: While Docker networking is powerful, it can become complicated in large-scale deployments or when connecting containers across multiple machines.</li></ol><h4>Kubernetes:</h4><ol><li><strong>Complexity</strong>: Kubernetes has a steep learning curve and can be challenging to set up and configure. It requires understanding concepts like pods, nodes, clusters, deployments, and more.</li><li><strong>Resource Intensive</strong>: Kubernetes requires a significant amount of system resources to manage clusters, especially when running at scale.</li><li><strong>Operational Overhead</strong>: Managing a Kubernetes cluster can be resource-intensive and requires ongoing monitoring, maintenance, and troubleshooting.</li><li><strong>Debugging Difficulty</strong>: Because of its distributed nature, debugging applications in Kubernetes can be more challenging than in a single containerized environment.</li></ol><h3>Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4vbg8RYAqjzDPqa8sJ5dOQ.png" /></figure><h3>Conclusion</h3><p>In summary, <strong>Docker</strong> is a powerful tool for developing and packaging applications into containers, while <strong>Kubernetes</strong> takes it a step further by orchestrating and managing containerized applications across a distributed environment. Docker is great for creating and running individual containers, but when you need to manage a large number of containers, automate scaling, and ensure high availability, Kubernetes is the go-to solution. The two technologies often work together, with Docker handling containerization and Kubernetes handling orchestration.</p><p>In essence:</p><ul><li><strong>Docker</strong> is for creating containers.</li><li><strong>Kubernetes</strong> is for managing clusters of containers at scale.</li></ul><p>If you’re working on smaller projects or individual containers, Docker alone may be sufficient. However, for large-scale, distributed systems, Kubernetes is the more comprehensive solution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5786d7213b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Containerizing a MERN Stack Application and Deploying]]></title>
            <link>https://medium.com/@dikshith2000bv/containerizing-a-mern-stack-application-and-deploying-fcdb3b49bb88?source=rss-e6959eb77374------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcdb3b49bb88</guid>
            <dc:creator><![CDATA[Dikshith B V]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 07:19:33 GMT</pubDate>
            <atom:updated>2025-02-13T07:19:33.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*zx2XGXBxQ-zIIZ4fAct-Gw.png" /></figure><h3>Basic Explanation of Frontend Code</h3><p>Frontend code typically refers to the HTML, CSS, and JavaScript (or JavaScript frameworks like React, Vue, or Angular) that makes up the user interface of a web application. This code runs in the user’s browser and interacts with backend services (API, databases, etc.) to display dynamic content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yeAGn63JAOl8Ta81WZsUCQ.png" /></figure><ol><li><strong>HTML (index.html)</strong>:</li></ol><p>This is the base HTML file where your app’s root div is located. It contains the overall structure (head, body) and loads the main JavaScript bundle.</p><p><strong>2. CSS (style.css)</strong>:</p><p>A separate file to handle the styling of the HTML components. It can either be plain CSS or managed by pre-processors like Sass.</p><p><strong>3. JavaScript (App.js)</strong>:</p><p>This file handles the logic of your application, such as event handling, state management, and rendering UI components.</p><p><strong>4. React Components</strong>:</p><p>If using React, the app is divided into multiple components (like header, footer, content areas) that handle specific UI tasks.</p><p><strong>5. Package.json</strong>:</p><p>This file lists the dependencies and scripts for building, testing, and running the application.</p><h3><strong>Why Dockerize ?</strong></h3><h4>1. Consistent Development Environment</h4><p>Docker allows you to create a containerized environment that mimics your production environment locally. This ensures that the application runs the same way across all systems, avoiding “it works on my machine” issues.</p><p>For example, you might be using specific versions of Node.js, npm/yarn, or other libraries. Docker ensures that these dependencies are set up exactly the same way for everyone working on the project.</p><h4>2. Simplified Deployment</h4><p>Once the application is containerized, you can easily deploy it on any system or cloud service that supports Docker. You don’t need to worry about configuring servers or ensuring the right versions of Node.js, npm, or dependencies are installed.</p><h4>3. Isolation</h4><p>Docker provides an isolated environment, meaning the frontend code runs in its own container, separated from other services (e.g., backend, database, etc.). This makes it easier to manage dependencies and avoid conflicts.</p><h4>4. Version Control for Environment</h4><p>When you Dockerize your frontend code, you define the exact environment in a Dockerfile. This file can be version-controlled, ensuring that every team member or CI/CD pipeline builds the app in exactly the same way.</p><h4>5. Easier CI/CD Pipeline</h4><p>Containerization simplifies continuous integration and delivery. Docker makes it straightforward to build and test the application in different stages (development, staging, production) using the same image, ensuring consistency across environments.</p><h4><strong>Example Dockerfile for Frontend Code (React App)</strong></h4><pre># Step 1: Build the React app<br>FROM node:16 AS build<br><br>WORKDIR /app<br><br># Install dependencies<br>COPY package*.json ./<br>RUN npm install<br><br># Copy source code and build the app<br>COPY . ./<br>RUN npm run build<br><br># Step 2: Serve the built app with a static server<br>FROM nginx:alpine<br><br># Copy the build output to Nginx&#39;s static directory<br>COPY --from=build /app/build /usr/share/nginx/html<br><br># Expose port 80<br>EXPOSE 80<br><br># Start Nginx<br>CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]</pre><h4>Create a network for the docker containers</h4><pre>docker network create demo</pre><h4>Build the client</h4><pre>cd mern/frontend<br>docker build -t mern-frontend .</pre><h4>Run the client</h4><pre>docker run --name=frontend --network=demo -d -p 5173:5173 mern-frontend</pre><h4>Verify the client is running</h4><pre>Open your browser and type http://localhost:5173</pre><h4>Run the mongodb container</h4><pre>docker run --network=demo --name mongodb -d -p 27017:27017 -v ~/opt/data:/data/db mongodb:latest</pre><h3>Basic Explanation of Backend Code</h3><p>In the backend, the code typically handles:</p><ul><li><strong>Routing</strong>: Defines the paths for API requests.</li><li><strong>Database interaction</strong>: Communicates with a database to fetch or store data.</li><li><strong>Business logic</strong>: Executes the necessary operations for the application (e.g., handling user authentication, CRUD operations, etc.).</li></ul><h4>Backend Code (Node.js with Express)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdLK6uhmsDT4nAy15W9pFw.png" /></figure><h4>connection.js (MongoDB Connection in Node.js)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zcC1KZPZ8fE7BLEM9ufeg.png" /></figure><p>connection.js file is used to establish a connection between your backend application (Node.js with Express) and MongoDB. This file typically contains the logic to connect to your MongoDB database and handle potential connection errors.</p><h4>Dockerizing the Backend</h4><p>Just like with frontend code, Dockerizing the backend ensures consistency across environments, easier deployment, and scalability.</p><p><strong>Example Dockerfile for Backend</strong></p><pre># Step 1: Use Node.js official image to create the build environment<br>FROM node:16<br><br># Set the working directory inside the container<br>WORKDIR /app<br><br># Copy the package.json and package-lock.json (if present)<br>COPY package*.json ./<br><br># Install dependencies defined in package.json<br>RUN npm install<br><br># Copy the rest of the application code to the container<br>COPY . .<br><br># Expose port 5000 to access the app<br>EXPOSE 5000<br><br># Command to start the server<br>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><h4>Build the server</h4><pre>cd mern/backend<br>docker build -t mern-backend .</pre><h4>Run the server</h4><pre>docker run --name=backend --network=demo -d -p 5050:5050 mern-backend</pre><h3>Conclusion</h3><p>By dockerizing both the frontend and backend of your application, you can ensure a consistent environment for development, testing, and deployment. Docker simplifies dependency management, improves scalability, and reduces deployment issues, allowing you to focus more on the features and less on environment-specific problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcdb3b49bb88" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>